- Data Structure
- Networking
- RDBMS
- Operating System
- Java
- MS Excel
- iOS
- HTML
- CSS
- Android
- Python
- C Programming
- C++
- C#
- MongoDB
- MySQL
- Javascript
- PHP
- Physics
- Chemistry
- Biology
- Mathematics
- English
- Economics
- Psychology
- Social Studies
- Fashion Studies
- Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
What type of comments does C++ support?
Program comments are explanatory statements that you can include in the C++ code. These comments help anyone reading the source code. All programming languages allow for some form of comments.
C++ supports single-line and multi-line comments. All characters available inside any comment are ignored by C++ compiler.
Single line comments
To create a single line comment, we use the // notation. Wherever you want to start the comment, start it with //. For example,
// This is a comment cout<<"Hello"; // This is a comment following a statement.
Multiline comments
Multiline comments span multiple lines and are often called block comments. You can use it using the /* */ notation. For example,
/* This is a Multiline comment */
Advertisements