© The Author(s), under exclusive license to APress Media, LLC, part of Springer Nature 2023
S. DmitrovićModern C++ for Absolute Beginnershttps://doi.org/10.1007/978-1-4842-9274-7_4

4. Our First Program

Slobodan Dmitrović1  
(1)
Belgrade, Serbia
 
Let us create a blank text file using the text editor or C++ IDE of our choice and name it source.cpp. First, let us create an empty C++ program that does nothing. The content of the source.cpp file is
int main(){}
The function main is the main program’s entry point, the start of our program. When we run our executable, the code inside the main function body gets executed. A function is of type int (and returns a result to the system, but let us not worry about that just yet). The reserved name main is a function ...

Get Modern C++ for Absolute Beginners: A Friendly Introduction to the C++ Programming Language and C++11 to C++23 Standards now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.