All about problems in Volume 108. If there is a thread about your problem, please use it. If not, create one with its number in the subject.
Moderator: Board moderators
- Posts: 1080
- Joined: Thu Dec 19, 2002 7:37 pm
Your scanf() reads a string into a char variable. You can run into all kinds of trouble this way.
- A great helper
- Posts: 481
- Joined: Sun Jun 19, 2005 1:18 am
- Location: European Union (Slovak Republic)
little joey wrote:Your scanf() reads a string into a char variable. You can run into all kinds of trouble this way.
Yea, that's right... he should use " %c" instead of "%s". (not forgetting the space before %c to skip whitespaces.)
- Learning poster
- Posts: 74
- Joined: Wed Apr 14, 2004 11:14 pm
I changed "%s" to " %c" and got AC!
Thanks little joey and Martin