Continuing Part One
Introduction - What is C++
upon the result of execution to give you the output. Somestudents have used these results of execution to study several chapters of this tutorial on an airplane by referring to a
hardcopy of the example programs.
In the text of this tutorial, keywords, variable names, andfunction names will be written in bold type as an aid when you are studying the example programs.
hardcopy of the example programs.
In the text of this tutorial, keywords, variable names, andfunction names will be written in bold type as an aid when you are studying the example programs.
DIFFERENT C++ IMPLEMENTATIONS
-----------------------------------------------------------------
-----------------------------------------------------------------
There are primarily two standards for naming C++ files, one usingthe extension CPP and the other using the extension CXX. All files in this tutorial use the CPP extension for naming files. If your compiler requires the CXX extension it will be up to you to rename the files. When C++ was in its infancy, header files generally used the extension .HPP, but there is a definite trend
to use .H for all header files. For that reason all header filesin this tutorial will use that convention.
Even though we have tried to use the most generic form of allconstructs, it is possible that some constructs will not actually compile and run with some C++ compilers. As we find newimplementations of C++, and acquire copies of them, we willcompile and execute all files in an attempt to make all example programs as universal as possible.
The C++ language is very new and is changing rapidly. Thedeveloper of the language, AT&T, has changed the formal definition several times in the last few years and the compilerwriters are staying busy trying to keep up with them. It would be best for you to search the more popular programming magazines for evaluations and comparisons of compilers. New C++implementations are being introduced at such a rapid rate, thatwe cannot make a compiler recommendation here.
A committee is currently meeting to produce an ANSI-C++ standard,but the standard is not expected to be available for general use until sometime in 1996. Until then we must expect a few changes to the language.
to use .H for all header files. For that reason all header filesin this tutorial will use that convention.
Even though we have tried to use the most generic form of allconstructs, it is possible that some constructs will not actually compile and run with some C++ compilers. As we find newimplementations of C++, and acquire copies of them, we willcompile and execute all files in an attempt to make all example programs as universal as possible.
The C++ language is very new and is changing rapidly. Thedeveloper of the language, AT&T, has changed the formal definition several times in the last few years and the compilerwriters are staying busy trying to keep up with them. It would be best for you to search the more popular programming magazines for evaluations and comparisons of compilers. New C++implementations are being introduced at such a rapid rate, thatwe cannot make a compiler recommendation here.
A committee is currently meeting to produce an ANSI-C++ standard,but the standard is not expected to be available for general use until sometime in 1996. Until then we must expect a few changes to the language.
PRINTING THE EXAMPLE PROGRAMS-----------------------------------------------------------------
Some students prefer to work from a hardcopy of the example
programs. If you desire to print out the example programs, there
is a batch file on the distribution disk to help you do this.
Make the distribution disk the default drive and type PRINTALL at
the user prompt. The system will print out about 140 pages of
C++ programs, all of the example programs in this tutorial.
programs. If you desire to print out the example programs, there
is a batch file on the distribution disk to help you do this.
Make the distribution disk the default drive and type PRINTALL at
the user prompt. The system will print out about 140 pages of
C++ programs, all of the example programs in this tutorial.
The PRINTALL batch file calls the program named LIST.EXE oncefor each example program on the distribution disk.
PROGRAMMING EXERCISES
-----------------------------------------------------------------
-----------------------------------------------------------------
There are programming exercises given at the end of each chapterto enable you to try a few of the constructs given in the chapter. These are for your benefit and you will benefit greatlyif you attempt to solve each programming problem. If you merely read this entire tutorial, you will have a good working knowledge of C++, but you will only become a C++ programmer if you writeC++ programs. The programming exercises are given as suggestions to get you started programming.
An answer for each programming exercise is given in the ANSWERS directory on the distribution disk. The answers are all given in compilable C++ source files named in the format CHnn_m.CPP,where nn is the chapter number and m is the exercise number. Ifmore than one answer is required, an A, B, or C, is included following the exercise number.
An answer for each programming exercise is given in the ANSWERS directory on the distribution disk. The answers are all given in compilable C++ source files named in the format CHnn_m.CPP,where nn is the chapter number and m is the exercise number. Ifmore than one answer is required, an A, B, or C, is included following the exercise number.