I have a restriction on the maximum size of an array (N), and I want to ask the user to input an array of numbers that can be less than or equal to N. How do I find how many values the user has inputted?
This is what I have, and it's not working.
(basically, i'm telling the program to stop counting "n" once the user hits enter) (and ofcourse i initialized n=0)
for(i=0;i<(N-1);i++)
{
scanf("%d",&a[i]);
n++;
if(a[i]=='/n'){break;}
}
any help is appreciated! thanks!