C++ Hello World Program| Visual Studio Code | Hello World Program | C++ tutorial #CodeOnTrend #C++
Name of the above C++ file is main.cpp. Extension of a C++ file is .cpp.
Let us go into the program and understand it line by line.
Line 1 – An include statement. We are including iostream header file to use the functionalities in it. There are many header files that come included with C++. You can include one header file using one include statement. To include multiple header files in your program, write an include statement for each one of them.
You can also create a header file of your own, in which you define some functionalities. And then you can include that header in your program.
Line 2 – Using namespace statement. Namespaces is kind of grouping of variables under a single name. In this statement we specified that we shall use the namespace named std. std has variables defined like cout which we used in the program in line 5. If you are not writing this using namespace statement, you have to write std::cout instead of cout. While going forward, you will see that writing this namespace statement is useful to ease out the code.
Line 3 – An empty line. You can write empty lines in your C++ program. This lets you have some space between your statements and function. Just to increase the readability of program. Empty lines or spaces are ignored by C++ compiler.
Line 4 – A function definition. We are defining a function named main that returns an integer and accepts no arguments. You will see main() in most of our C++ programs. This is because main() function is kind of an entry point to the execution of a C++ program. We also have a flower brace that starts the scope of this main() function.
Line 5 – cout can be used to write an object or value to standard output.
Line 6 – Ending flower bracket. This closes the scope of main function. Body of main() function, which includes all the statements inside it, should be enclosed between flower braces.
Conclusion
In this #C++ Tutorial, we learned how to write a basic hello world program in C++.
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «C++ Hello World Program| Visual Studio Code | Hello World Program | C++ tutorial #CodeOnTrend #C++», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.