C++ is a programming language, but what exactly is a program? A program is a set of instructions executed in sequence to give a desired output.
Let's look at our first program:
#include <iostream> // Program prints out "Hello, World" to screen int main() { std::cout<< "Hello, World."<<std::endl; return 0; }
We can look at this code line by line.
The hash (#) include is used when we want to include anything that is using valid C++ syntax. In this case, we are including a standard C++ library in our program. The file we want to include is then specified inside the <> angle brackets. Here, we are including a file called iostream.h. This file handles the input and output of data to the console/screen.
On the second line, the // double slash marks the initiation of a code comment. Comments in code are not...