473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

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

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

--
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?
Jul 23 '05 #1
2 1827
* Alf P. Steinbach:

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

<url: http://home.no.net/dubjai/win32cpptut/w32cpptut_01_06.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.


--
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?
Jul 23 '05 #2
* Alf P. Steinbach:
* Alf P. Steinbach:

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


Should of course be

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


I found an error in the _introduction_, where my pesky keyboard had inserted
words to the effect that std::getline has no call result.

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?
Jul 23 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Rick | last post by:
Hello all. I have an index.php file that has a lot of functions that I wrote. Let's say for the sake of argument that there are 1000 functions of 100 lines each. The index.php file is invoked...
3
by: elektrophyte | last post by:
I was looking at the PHP function "call_user_func()" (http://us3.php.net/call_user_func). It appears that this will solve a design problem in the app I'm working on. (I'm writing a class that will...
0
by: Iker Arizmendi | last post by:
Hello all. Is there a convenient scheme within a C extension to add methods to a type in such a way as to allow me to transparently add a "proxy" around them? For example: typedef PyObject*...
0
by: Chris | last post by:
Can someone point me the right way? I'm trying to use the date/time extensions but with little luck. Here's what I've got: <?xml version="1.0" encoding="UTF-8"?> <xsl:stylesheet version="1.0"...
9
by: rnn98 | last post by:
hi, my multithread application, running under solaris box, is crashing eventually. I tried to spot and substitute functions not "thread safe", but I guess my search wasn't good enough. I have put...
1
by: Robert Heuvel | last post by:
Why did you devise invoking generics functions like you did? I understand that the method of use is "compatible" to that of generic classes but isn't it a bit clumsy? Or am I missing something? ...
5
by: active | last post by:
In windows XP and VB.NET should the "W" functions in the Windows API be used or should the "A" functions be used I'm looking at a type library and see things like the following: #ifdef...
8
by: =?Utf-8?B?UiBSZXllcw==?= | last post by:
I have a public class called Database.cs. It has public static functions and I call them from ProjectA. The code looks something like: int intConnectionSuccessful = Database.ConnectToDatabase();...
7
by: Luna Moon | last post by:
#include "stdafx.h" #include <iostream> #include <string> using namespace std; int main() { string cc(31, 'c'); string bb=cc.assign(3, 'dd');
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.