Home > Back-end >  Questions about the scanf input the char type
Questions about the scanf input the char type

Time:09-30

Scanf_s (" % c ", & amp; YN, sizeof (YN));
The fflush (stdin);

Two code, just like this should be only read one character at a time, but after I input the ABC, he would read a, b read, read c, is there a way to let him read only one

CodePudding user response:

Scanf_s (" % c ", & amp; YN, 1) so that it will read only 1 characters

CodePudding user response:

Getchar
  • Related