
- C++ Basics
- C++ Home
- C++ Overview
- C++ Environment Setup
- C++ Basic Syntax
- C++ Comments
- C++ Data Types
- C++ Variable Types
- C++ Variable Scope
- C++ Constants/Literals
- C++ Modifier Types
- C++ Storage Classes
- C++ Operators
- C++ Loop Types
- C++ Decision Making
- C++ Functions
- C++ Numbers
- C++ Arrays
- C++ Strings
- C++ Pointers
- C++ References
- C++ Date & Time
- C++ Basic Input/Output
- C++ Data Structures
- C++ Object Oriented
- C++ Classes & Objects
- C++ Inheritance
- C++ Overloading
- C++ Polymorphism
- C++ Abstraction
- C++ Encapsulation
- C++ Interfaces
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 */
- Related Articles
- Does Python support polymorphism?
- Does MySQL support table inheritance?
- Does Python support multiple inheritance?
- Does java support hybrid inheritance?
- Does JavaScript support block scope?
- Does Selenium support Safari browser?
- Does HTML5 Canvas support Double Buffering?
- Does C++ support Variable Length Arrays
- Does Java support multi-dimensional Arrays?
- Does Selenium support headless browser testing?
- What type of force does the wheel reduce?
- Does cypress support api automation testing also?
- On what factors does our type of clothing depend?
- What are JSP comments?
- Does it make sense to use HTML comments on blocks of JavaScript?

Advertisements