Re: Correct C++ tutorial part 3 "Intro to loops" available (Windows, mingw/msvc/std)

From: Alf P. Steinbach (alfps_at_start.no)
Date: 01/20/05


Date: Thu, 20 Jan 2005 05:07:07 GMT


* Alf P. Steinbach:
> The third part of my attempted Correct C++ tutorial is now available,
> although for now only in Word format (use free Open Office if no Word),
> and also, it's not yet been extensively reviewed -- comments welcome!
>
> "Intro to loops"
> <url: http://home.no.net/dubjai/win32cpptut/w32cpptut_01_03.doc>
>
> As before I expect that here's mental food and technical points that
> we can strongly disagree about, for both newbie and the experienced.
>
> And as before the point of inviting comments is to _fix_ anything
> incorrect, or the presentation, or whatever; your input is valuable.

Well, I discovered one Big Blunder myself! :-o

In section 4, "[Pitfall:] Using assignment instead of comparision",
I described an if-condition as accepting non-bool values because it
converted bool to numerical zero / non-zero. That was correct as an
effective belief, and may be the way it is in C, but it's not how it
actually works in C++. In C++ the same _effect_ is achieved by having
implicit conversion of non-bool values (zero, non-zero) to bool.

Now corrected...

-- 
A: Because it messes up the order in which people normally read text.
Q: Why is it such a bad thing?
A: Top-posting.
Q: What is the most annoying thing on usenet and in e-mail?