Note that the tutorials are displayed in order of difficulty! (From beginner to experienced.)

History of the C++ language

In this first C++ programming language tutorial we are going to look at the history of the C++ language.

The C programming language was devised in the early 1970s by Dennis M. Ritchie an employee from Bell Labs (AT&T). (To view a brief history of the C language; click here).

Many other programming languages are derived from the C language. Some did well and some did not. The languages Objective-C and C++ for instance are derived from the C language.  Both languages add the “object oriented” element to the language C. One of the most recent languages, that used much of the C language, is Java. More »


Posted in C++ Tutorials | 0 Comments


C++ Compilers (GNU and Visual Studio)

A compiler is a program that translates one language (high level) into another language (e.g., assembly language or machine specific language). A compiler translates source code (plain text) into object code (normally in a form suitable for processing by other programs (like a linker)). The most common reason for wanting to translate source code is to create an executable program. More »


Posted in C++ Tutorials | 0 Comments


First C++ program, hello world

We start the tutorial series with one of the simplest programs that can be written in the C++ language. More »


Posted in C++ Tutorials | 9 Comments


C++ Variables and Data Types

In this C++ programming tutorial we take a look at variables and data types.

Variables

If you declare a variable in C++ (later on we will talk about how to do this), you ask the operating system for
a piece of memory. You (can) give this piece of memory a name and you can store something in that piece of memory (for later use). More »


Posted in C++ Tutorials | 10 Comments


C++ constants, escape codes and strings

In this tutorial we will take a look at constants and escape codes. We will also introduce strings.

Constants

The difference between variables and constants is that variables can change their value at any time but constants can never change their value. (The constants value is locked for the duration of the program.)
Constants can be very useful, PI for instance is a good example to declare as a constant. More »


Posted in C++ Tutorials | 0 Comments


C++ operators, compound assignments

Now we know how to use variables and constants, we can begin to use them with operators. Operators are integrated in the C++ language. The C++ operators are mostly made out of signs (some language use keywords instead.)

Assignment

We used this operator before and it should already be known to you. For the people that didn’t read the previous tutorials we will give a short description. More »


Posted in C++ Tutorials | 5 Comments


C++ Standard I/O – cin and cout

In this tutorial we will take a look at basic input and output. Using the C++ iostream library we will get the user’s input from the keyboard and we will print messages onto the screen. The iostream library is part of the C++ standard library.

In C++, I/O is performed by using streams. A stream is a “stream of data” in which character sequences are “flow into” or “flow out off.” A stream is an object with properties that are defined by a class. Global objects are predefined for the standard I/O channels. More »


Posted in C++ Tutorials | 5 Comments


C++ Standard I/O and strings

In this tutorial we take a look at standard I/O and strings. The string statements used in this tutorial are basic. Later on we will take another look at strings. (We first need to explain some other topics like: control loops, pointers, etc).

cin and strings

In the last tutorial we already covered the use of cin and cout. Let’s take another look at a cin and cout example: More »


Posted in C++ Tutorials | 4 Comments


C++ The if statement and switch statement

In this C++ programming tutorial we take a look at the “if statement” and “switch statement”. Both are used to alter the flow of a program (if the specified test condition is true).

The if statement

The if statement can be used to test conditions so that we can alter the flow of a program. In other words: if a specific statement is true, execute some instructions. If not true, execute these instructions. More »


Posted in C++ Tutorials | 8 Comments


C++ for loops, while loops

In this C++ programming tutorial we will look at loops.

There are circumstances were you want to do the same thing many times. For instance you want to
print the same words ten times. You could type ten cout statements, but it is easier to use a loop, such as a “for loop” or a “while loop.” The only thing you have to do is to setup a loop that execute the same cout statement ten times.

There are three basic types of loops which are: More »


Posted in C++ Tutorials | 29 Comments