|
-
September 4th, 2012, 10:27 AM
#5
Re: Do {} while errors
 Originally Posted by B00MJUICE
Hey all,
Started learning C++ a few days ago, and just finished my first half-useful program. It's basically a converter for weight, distance and currency.
So I'll ask you --
what if there were 100 conversions available? Would you write a case statement that has 100 sections, or a gigantic while loop condition with 100 tests? What if that number were upped to 300 different conversions? You would quit C++ as fast as anything if you really had to write 300 case statements and one heck of a gigantic while loop condition at the end.
This is a time to take a step back, look at your code, and determine if this is the way to write something like this. As GCDEF stated, learn to use arrays
Regards,
Paul McKenzie
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|