Page 1 of 1

Problem with scanf vector

Posted: Wed Jun 22, 2016 10:32 pm
by nealcaffrey
Hi everybody,
I wrote these few lines of code:

#include <stdio.h>

int main(int argc, char **argv)
{
int v[5];
int i,j;

for(i=0;i<5;i++){
scanf("%d", &v);
}
for(j=0;j<5;j++){
printf("%d", v[j]);
}
return 0;
}

There are no errors in compiling phase...
This is the Build Output:
Current working directory: /Users/Francesco/ProgettiCodeLite/debugger/Debug
Running program: /usr/bin/open /Applications/codelite.app/Contents/MacOS/codelite-terminal.app --args --exit --wait --working-directory "/Users/Francesco/ProgettiCodeLite/debugger/Debug/" --title "./debugger " --cmd ./debugger
Program exited with return code: 0

So codelite launches the terminal where I can type the "INT" numbers in order to fill the vector.

It is now that I face the problem: I can type every number from keyboard but the button "RETURN" of the keyboard seems not to function... so I cannot enter the second number, since the first one has no ending!
For example I can type: 3434433355 as first number, but since the "RETURN" button doesn't function I cannot enter the 2nd number of the vector

What can I do to solve that matter?
Thank you Guys, waiting for you!