Making repeated input in one line

So basically i want to input undefined size of array with number but still within one line in console. the problem is everytime i make input the cursor will go to a new line like "\n" is there a way to prevent it going to new line? (without using gotoxy)

1
2
3
4
5
int x=10;
int y[x];
for(int i=0;i<x;i++){
    scanf("%d",y[i]);
}
So basically i want to input undefined size of array with number

Please take a look here:
http://www.programiz.com/c-programming/c-dynamic-memory-allocation

EDIT:
You will also find many examples of algorithms and programs in C.
Last edited on
Topic archived. No new replies allowed.