entering number in an array

I want to take integer input in an array until i press the enter key.

the portion of code is
j=0;
while(j<10001){
scanf("%d",&input );
if(input==’\n’)break;
else
{
m[j]=input;
j++;
}
}

But this code is not working .Can anyone give the solution.Thanks;

Well, you can enter the line as a string , such as getline(cin,s);

Then you can search for spaces in the string thereby getting the numbers.

You are comparing and int(input) with character constant and also the scanf("%d") is used for integer format so due to problem it is not possible

use wherey().It will help.

simple solution to your problem is :(input doesn’t contain any spaces) take a string variable str[1000] and use scanf("%s",str); now it will store input as characters…
Note: if input has some spaces use :
getchar();
gets(str);
/* getchar() has been used to empty the buffer*/
ENJOY CODING