How can i use scanf to read string with blank space(without enter)? And i also want this program to stop whenever input is EOF.
I used the following code:
int main() //this is not the whole program
{
char A[10000];
int length;
while(scanf(" %[^\n]s",A)!=EOF);
{
length=strlen(A);
print(length,A);
//printf("HELLO\n");
}
return 0;
}
But it is reading two EOF(ctrl+Z) to stop the program.can anyone give me any suggestion?