Notice: This page requires JavaScript to function properly.
Please enable JavaScript in your browser settings or update your browser.
Get Started | Basics
Introduction to C++
course content

Зміст курсу

Introduction to C++

Introduction to C++

1. Basics
2. Variables
3. Conditional Statements
4. Loops
5. Intro to Arrays

book
Get Started

Welcome to the course! Today we will start learning C++.

Let’s firstly understand how this programming language works and where it can be used.

C++ is an extremely popular cross-platform programming language for creating high-performance applications: operating systems, games, web browsers, compilers, advanced computation, graphics, and so on. A large number of programs or their parts that you have ever seen are written in C++ or C!

Take a look at the standard program’s body in C++ which prints "Hello World!":

Let’s understand what’s going on here:

Line #1: It's a header file library that contains information for the program's work. In this case, <iostream> is just a magic tool that helps output and input data.

Line #2: using namespace std means that we can use the standard (std) namespace for variables’ and objects’ names.

Don’t worry about these two lines if you haven’t completely understood what they do. Just take into account that it’s something that must (almost) always appear in your code.

Line #4: The most important point of every code in C++ is int main(). The function main() is needed to represent what the program does. Your code will start in curly brackets {}

Line #5: Prints “Hello World!”. We will see how it works in the next chapter.

Line #6: return 0 ends the work of the main() function.

Each statement in C++ should be ended with a semicolon ;

question-icon

Fill the gap:

#include <iostream>
using namespace std;
{
    cout << "I’m learning C++!";
    return 0;
}
I’m learning C++!

Натисніть або перетягніть елементи та заповніть пропуски

Все було зрозуміло?

Як ми можемо покращити це?

Дякуємо за ваш відгук!

Секція 1. Розділ 1
We're sorry to hear that something went wrong. What happened?
some-alt