This repository contains C++ sample codes that I adopted from various sources to help instruct programming in C++ in 2005. These samples try to help newcomers quickly find an appropriate pattern for solving their programming problems. Also they can quickly find out how a certain language construct, or a popular function is generally used.
These samples are by no means complete, nor free from deficiencies. Feel free to make them complete or introduce them to more C++ newbies or teachers. The samples cover only the standard/ISO C++ language.
To access or contribute the most recent modifications of these samples, find their github repository here: https://github.com/sinairv/CppTutorialSamples
Each sample has a separate folder of its own, and is usually in a file named Prog.cpp
. If you want to build a sample with Microsoft Visual Studio, then you need to create a project and copy the sample into that project by your own.
However there's a Makefile
in each directory, which makes the process of building and running the samples easier in Linux/Unix and Cygwin. In order to build each sample, simply cd
to its directory and run make
to build the required executable. Run make clean
to clean-up your directory. Also make full
, first cleans and then rebuilds each sample.
Beside several Internet sources, the following are the main references that I used during the course of creating these samples. Most of the samples are adopted from the first reference. Even many of the comments are quoted from it. I strongly recommend studying the first reference, if you are learning C++ as a first programming language.
[1] H. Deitel and P. Deitel, C++ How to Program, 5th ed. Prentice Hall, Jan. 2005.
[2] B. Stroustrup, The C++ Programming Language, 3rd ed. Addison-Wesley Professional, Jun. 1997.
[3] H. Schildt, C++: The Complete Reference, 4th ed. McGraw-Hill Osborne Media, Nov. 2002.
Sina Iravanian: [email protected]