| delorie.com/archives/browse.cgi | search |
| Date: | Sat, 6 May 1995 09:51:28 +0100 |
| From: | gbm AT ii DOT pw DOT edu DOT pl (Grzegorz B. Mazur) |
| To: | djgpp AT sun DOT soe DOT clarkson DOT edu, jkeene AT unlinfo DOT unl DOT edu |
| Subject: | Re: What stupid error am I making? |
This is not scanf who ignores '\n'. Whitespaces are ignored if you use some formats (like %d, %f, etc.). %c causes scanf to read the next byte from stdin, no matter if it is '1', '0', space or lf. The simplest (but not the best) solution is to use "%c\n" format that skips '\n' following the char entered. Gregory
| webmaster | delorie software privacy |
| Copyright © 2019 by DJ Delorie | Updated Jul 2019 |