Зміст курсу
Introduction to C++ | Mobile-Friendly
Introduction to C++ | Mobile-Friendly
Get Started
Welcome to the course! Today we 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 used 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 ;
Дякуємо за ваш відгук!