Instructions for use C and C++ / Getting Started
This tutorial is for those people who want to learn programming in C++ and do not necessarily have any previous knowledge of other programming languages. Of course any knowledge of other programming languages or any general computer skill can be useful to better understand this tutorial, although it is not essential.
Basic Input/Output C and C++ / Getting Started
Using the standard input and output library, we will be able to interact with the user by printing messages on the screen and getting the user's input from the keyboard.
Arrays C and C++ / Getting Started
An array is a series of elements of the same type placed in contiguous memory locations that can be individually referenced by adding an index to a unique identifier.
Character Sequences C and C++ / Getting Started
As you may already know, the C++ Standard Library implements a powerful string class, which is very useful to handle and manipulate strings of characters. However, because strings are in fact sequences of characters, we can represent them also as plain arrays of char elements.
Dynamic Memory C and C++ / Getting Started
Until now, in all our programs, we have only had as much memory available as we declared for our variables, having the size of all of them to be determined in the source code, before the execution of the program. But, what if we need a variable amount of memory that can only be determined during runtime? For example, in the case that we need some user input to determine the necessary amount of memory space.
Data Structures C and C++ / Miscellaneous
We have already learned how groups of sequential data can be used in C++. But this is somewhat restrictive, since in many occasions what we want to store are not mere sequences of elements all of the same data type, but sets of different elements with different data types.
Control Structures C and C++ / Functions and Classes
A program is usually not limited to a linear sequence of instructions. During its process it may bifurcate, repeat code or take decisions. For that purpose, C++ provides control structures that serve to specify what has to be done by our program, when and under which circumstances.
Functions (I) C and C++ / Functions and Classes
Using functions we can structure our programs in a more modular way, accessing all the potential that structured programming can offer to us in C++.
Functions (II) C and C++ / Functions and Classes
Until now, in all the functions we have seen, the arguments passed to the functions have been passed by value. This means that when calling a function with parameters, what we have passed to the function were copies of their values but never the variables themselves.