Correct C++ tutorial part 6 "Functions, a.k.a. routines" available (Windows, mingw/msvc/std)

A

Alf P. Steinbach

The sixth 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 reviewed at all -- comments welcome!

"Functions, a.k.a. routines"
<url: http://home.no.net/dubjai/win32cpptut/w32cpptut_01_05.zip>

General URL:

<url: http://home.no.net/dubjai/win32cpptut/html/>

which provides parts 1 and 2 as web-pages (HTML) in addition to the
original Word documents of parts 1 through 6 in zipped format.

Since Word managed to add almost 800 KiB of empty space to the last file
I thought zipping it might be a Good Idea, bringing it down to 90 KiB.

Sorry, there's no C++ curve! Next part, probably. For now there are some
other interesting pictures and techniques, and I think perhaps this part
again may encourage lively discussion for both newbie and experienced (as
even the "Hello, world!" of part 1 did, not to mention "Variables" part 2!).

Contents, part 6:

1 Refactor by defining a simple & useful command routine.
2 [Pitfall:] Forgetting argument list in a routine call.
3 Define routines with call results (function routines).
4 Define routines with value arguments & overload ’em.
5 Simplify by defining data conversion function routines.
6 [Background:] Reuse via logical modules.
7 Create and understand a module header file.
8 Use a module header file with namespace in a program.
9 Create and understand a module implementation file.
10 [Tool usage:] Build modules and a program that uses them.
11 Implement an algorithm as a routine.
12 Use assertions.
13 Explore and play: generate some interesting pictures.
14 Wrap an awkward interface in an easier-to-use interface.
15 Use pass-by-reference arguments.
16 Secure and optimize by passing by reference to const.
17 [Pitfall:] Return by reference can be very dangerous.

As before, the point of inviting comments is to _fix_ anything incorrect, or
the presentation, or whatever; your input is valuable, and you can thereby
help those who stumble across this tutorial and use it to learn C++.

Thanks in advance,

- Alf
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top