I want to read an unknown number of characters, which are not greater than 10.
char word[10];
for( i=0;i<10;i++){
if( !scanf("%c",&word[i])){ //terminate with 0
getchar();
break;
}
}
The problem is that number is also an character, so the if statement won't be executed. Is there any other solution to terminate the input of characters for example with 0.