Let us run a simple hello world program in C++ in visual studio.
If you want to know about visual studio and its installation you can visit our post about that. here is the link to it.
Open up the visual studio from desktop shortcut or by searching cmd. You will see the window.
Click on create a new project.
Choose console App from the menu and click next. This will provide a simple hello world code by default so you will get the basic idea of syntax.
Give an appropriate project name so you can easily find it later.
You will see the window below.
Below the top bar there exist the run button as.
Click the button to start debugging and then it will run your program.
If your code is error free than it will show the output screen as.
All the info regarding your code will be shown below on console as.
Thats how you start your C++ coding in visual studio. We will try to make more detailed and informative tutorials for beginners.
Now let us understand the above hello world program written in C++:
- The above program prints message “Hello, world!” and has the following major parts:
- starting the execution of C++ program with the function called main; every C++ program must define function called main.
- #include preprocessor directive to include complete contents of file.
- iostream standard header file that defines various types and variables related to I/O
- std::cout is standard output stream.
- operator << is used for output.
0 Comments