GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing www.dremendo.com — Learn the Basic Structure of a C++ Program | Dremendo
?>
Announcements
No new announcements.
C++ Programming Tutorial
Table of Contents
Learn the Basic Structure of a C++ ProgramIn this lesson, we will learn about the essential includes of a C++ program and its basic structure. Basic Structure of a C++ ProgramBefore we start learning how to write a program in C++, let us first understand how a basic structure of a C++ program look likes.
Video Explanation
Click the button below to watch the explanation.
Please wait while the video is loading....
Example
This is how a simple basic structure of a C++ program looks like.
Note
Every C++ program must be saved in a text file with the .cpp extension, like hello.cpp, so the compiler knows it is a C++ source file. Now we will discuss the various parts of the basic structure of a C++ program given above. Preprocessor Directive
Header File
namespace std
Program Main Function (Entry Point)
Main Function Return Type
Opening Brace {
Body of Main Function
Main Function Return Value
Closing Brace }
What is a CompilerA compiler is a special program that translates your C++ code (which humans can read) into machine code (which computers can understand and execute). Steps Involved in Compiling a C++ ProgramCompiling a C++ program is like turning your handwritten instructions into something a computer can understand and execute. When you write a C++ program and save it with a .cpp extension, the journey from source code to executable goes through four main steps and they are:
Test Your KnowledgeAttempt the questions in the exercise to check whether you have understood the lesson clearly.
We care about your privacyDremendo uses cookies and similar technologies that are necessary for the site to work properly, understand how you interact with our website, and measure the effectiveness of our marketing. By clicking Accept All, you consent to the use of non-essential cookies and similar technologies for analytics, advertising, and ad measurement, as described in our Privacy Policy. Cookie PreferencesChoose which types of cookies Dremendo may use.
Necessary Cookies
Allow
Required for essential website functionality and security.
Analytics Cookies
Allow
Help us understand how visitors use Dremendo.
Marketing Cookies
Allow
Help us measure advertising performance and understand interactions with our advertisements.
Mentora
Question Asked: 0 / 20
Hi, I’m Mentora! I’m your personal AI tutor from Dremendo. Ask me anything, and I’ll help you understand it in a simple and easy way. |
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |