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 — Comments in C++ Programming and its Use | Dremendo
?>
Announcements
No new announcements.
C++ Programming Tutorial
Table of Contents
Comments in C++ Programming and its UseIn this lesson, we will learn what is a comment and how can we use it for better coding, with the help of some example. What are CommentsIn C++ program Comments are portions of the code ignored by the compiler which allow the user to make simple notes in the relevant areas of the source code.
Video Explanation
Click the button below to watch the explanation.
Please wait while the video is loading....
Comments in C++ programming are used to provide information about lines of code. It is widely used for documenting code. There are 2 types of comments in C++ programming.
Let's see some example for more understanding.
Example 1 (Single-Line Comments)
Output
Hello World In the above program, we have used two single-line comments to explain the program. The first one is // Printing Hello World on the screen. and the second one is // This line will print Hello World on the screen.
Example 2 (Multi-Line Comment)
Output
Hello World In the above program, we have used multi-line comments to explain what the program is all about. We can also comment out any statement that we don't want to execute in your program but want to keep it for future reference as shown above. We have commented out the statement //cout<<"\nThis is a C++ tutorial";. 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. |