|
-
March 18th, 2013, 09:44 PM
#10
Re: control structure outputting wrong iterations via ints.
Actually, you did screw up your loop code in the snippet from post #7: Your termination check expression is an assignment instead of a comparison, so it not only unintentionally modifies your loop control variable, it also unconditionally evaluates to false. So I strongly doubt the stoi() call inside that loop would ever throw any sort of exception or other runtime error, since it never gets executed.
If you don't like books with a scholar attitude, and you're not going to learn C++ (that apparently you do not know perfectly by now) from the original ANSI/ISO standard document, which I wouldn' recommend to anyone at all for its high tideosity and boredom factor, I'd recommend to you Stroustrup's TC++PL. Due to its high level I do not recommend that book to beginners, but be warned that, yet, it's structured in chapters with increasing difficulty level that build upon each other, and it even does contain practice exercises.
And one more recommended reading (sorry for this one ): http://www.cplusplus.com/doc/tutorial/control/
I'd have to say quite some more, but typing is so tideous on the tablet...
I was thrown out of college for cheating on the metaphysics exam; I looked into the soul of the boy sitting next to me.
This is a snakeskin jacket! And for me it's a symbol of my individuality, and my belief... in personal freedom.
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
|