C++ Basics – Part 1

Published by on July 25, 2019
Categories: C++ Programming

We will start with a very basic C++ program. This will print just the word’s “Hello World” to your console.

The first line includes the iostream header file, which contains the definitions for standard input/output stream objects.

The main block has to exist as the entry point for the c++ program. it returns an integer 0 for success or any non 0 number for a failure.

The third line is the opening brace for the main function. this starts the scope of the main function. The fifth line is the closing brace which ends the scope for the main function.

The 4th line is our print to the console. This works by using the << operator in the case of cout it is called a insertion operator not to be confused by a Left Shift operator.

This is the first very basic C++ program. In the next topic i will dive into Types.

Leave a Reply

Your email address will not be published. Required fields are marked *