-
Forced writing
Greetings fellow travelers,
Is it possible in C/C++ to make console app in which no matter what you will write it will still write only one sentence? For example, this app will write the sentence "Go left" no matter what I type. I can type another sentence or I can just keep pushing one key, it will keep writing "Go left". Thanks for suggestions
-
Does the input even matter at that point?
Maybe just:
Code:
for ( ; ; ) {
int ch;
while ((ch = getchar()) != '\n' && ch != EOF) ;
if (ch == EOF) break;
printf("%s\n", "Go left");
}
-
I think it would fall into the piratical joke section.