![]() |
|
#1
|
|||
|
|||
"while loop" not reading 0's?Hi.
I'm taking a first year C++ class and need some help. First, this is what the assignment is asking for: Quote:
The professor gave us some sample numbers for testing our code. They are: Quote:
When I test 9578, 1039, and 9999, I get the correct new ID. However when I test the other 3 (which begin with 0), the new ID is incorrect. Here is the main part of my code: CPP / C++ / C Code:
Does anyone have any tips on how to fix it? Thanks. |
|||
|
#2
|
|||
|
|||
Re: "while loop" not reading 0's?Quote:
Look at the basis for your loop: CPP / C++ / C Code:
Otherwise, you get points for attempting cleverness. I commend you for it. Unfortunately, cleverness is frequently a two-edged sword. |
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 |
| contents of .txt file into 2D array | anirudhroxrulz | C Programming Language | 4 | 10-Apr-2008 23:45 |
| Reading from file to structure until '\n' | Simka | C Programming Language | 1 | 21-Dec-2006 16:20 |
| Help with reading data...getting garbage output | mnkdrt | C++ Forum | 2 | 02-Dec-2005 14:46 |
| Need Help reading HEX data from a sensor | Moooey | C Programming Language | 4 | 09-Mar-2005 14:46 |
| Reading File, Arrays, Editing File | Mary | MySQL / PHP Forum | 4 | 15-Jul-2003 03:14 |
Network Sites: GIDNetwork · GIDWebHosts · GIDSearch · Learning Journal by J de Silva, The