In this Merge K sorted Arrays Question, how to take inputs from user.
for eg…
user enters k=3;
so 3 arrays should be taken as input from user;
the size of each array is unknown.
How to take inputs in this case
User Inputs in Merge K sorted Arrays
thanks
but since number of inputs in each array is unknown .so how to iterate?
EOF i guess would read till end of inputs.
but in my case i want that for inputs of array 1 to be stored in a[1]; array 2 in a[2] and so on.
like the inputs are
0 1 2 3 // array 1
4 8 9 6 4 5 //array 2
1 2 3 8 10 12 //array 3
now using the condition of ‘\n’ …ie… read till enter key is pressed doesnt store the arrays as desired
Please help
Hey Arnav,
If your doubt is resolved, please mark it as resolved in your course’s “ Ask Doubt ” section.