View Single Post
rashiki

 
Member Since: Dec 26, 2008
Posts: 5
rashiki is on a distinguished road

rashiki is offline
Hi,

I am running into the same problem. I am starting out writing simple console programs using a cocoa project with XCode 2.5 and have been running into the same problem as you have with character variables and "while" looping. Funny thing is that if I do a "while" loop, if I set the "char" variable to 'y' for "yes" outside the loop first (so that it enters), and then use "scanf" inside the "while" loop, it will actually ask me for the letter, but just that first time. If I enter 'y' to do the loop again, it totally blows by the "scanf" the next time and then exits the "while" loop.

Have you figured anything out yet? I used an integer variable instead and used by conditional test with '0' or '1' and it doesn't blow by the "scanf" this way. Only with a character variable.

Ryan
QUOTE Thanks