How to write comments in C++
In this post we will give you information about How to write comments in C++. Hear we will give you detail about How to write comments in C++And how to use it also give you demo for it if it is necessary.
we are going to learn about how to write the comments in C++.
Comments helps us to understand the code in future, in case if we forgot what is happening on the particular line of code.
There are two ways to write comments in C++.
Single line comment
To we can write a single line comment in C++, we can use the forward slashes // followed by the comment.
Here is an example:
// this is a single-line comment
Anything we written after // is ignored by the compiler.
Multiline comments
To write a multiline comment, we can use C++ /* and */ syntax.
Here is an example:
/*you cansee meein multiple lines*/
The multiline comment starts after the /* and ends at */.
Hope this code and post will helped you for implement How to write comments in C++. if you need any help or any feedback give it in comment section or you have good idea about this post you can give it comment section. Your comment will help us for help you more and improve us. we will give you this type of more interesting post in featured also so, For more interesting post and code Keep reading our blogs