Nothing to be amazed.
It works since scanf() %d stops when encountering letter on next line, and it pushes back (ungetc()). the character.
If next line is allowed to start with number(not OP...
Type: Posts; User: Bayint Naung
Nothing to be amazed.
It works since scanf() %d stops when encountering letter on next line, and it pushes back (ungetc()). the character.
If next line is allowed to start with number(not OP...
Is it? But i don't think so.
Read a word. scanf %s does that.
Depending on the word(RUN,SET), you know how many more input to read.
Eg.
char command[21];
while( scanf("%20s",command) != EOF ) {
if(...