![]() |
|
#1
|
|||
|
|||
Why won't my DO WHILE loop loop? Please help.Here is my program written in Dev C++. I don't know what could be the problem. Please anyone help me. I am a novice in C.
CPP / C++ / C Code:
Last edited by LuciWiz : 04-Jul-2009 at 10:22.
Reason: Please insert your C code between [cpp] & [/cpp] tags
|
|||
|
#2
|
|||
|
|||
Re: Why won't my DO WHILE loop loop? Please help.Please use code tags.
Read up on some documentation on scanf (and family), you will find that the newline is left in the buffer when you read from stdin and that on subsequent reads you will either have to clear that or be aware of it in you comparisons. __________________
My personal site: Utilities for text processing, debugging, testing and plotting |
|
#3
|
|||
|
|||
Re: Why won't my DO WHILE loop loop? Please help.Quote:
Thanks man! That was so easy yet so confusing for me. Now my loop really loops. I had to do this --> scanf("\n%c", &repeatGame); |
|
#4
|
||||
|
||||
Re: Why won't my DO WHILE loop loop? Please help.You might want to read this series on scanf. It might help.
__________________
During the election they said Obama could only be elected when pigs fly. Well, we currently have an epidemic of Swine Flu. Coincidence? |
|
#5
|
|||
|
|||
Re: Why won't my DO WHILE loop loop? Please help.Quote:
Great man! thanks, www.gidforums.com |
Recent GIDBlog
Programming ebook direct download available by crystalattice
| Thread Tools | Search this Thread |
| Rate This Thread | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Classic recursion game of 8 Queens errors | BKizzle77 | Java Forum | 11 | 11-Aug-2008 01:35 |
| Exiting an infinite loop. | memmudu | C++ Forum | 1 | 31-Dec-2007 07:25 |
| breaking an infinite loop through stdin | pisuke | C Programming Language | 9 | 03-Jul-2007 21:19 |
| Text-Based Roulette Game | mfm1983 | C++ Forum | 5 | 29-Nov-2006 13:20 |
| messy loop help please | sammacs | C Programming Language | 6 | 26-Nov-2004 16:18 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The