Is "comment" compulsory in C++? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Is "comment" compulsory in C++?

is there any special use of single line comment/multi line comment....other than just explain process.

18th Jul 2017, 2:41 PM
Harshit Singh
Harshit Singh - avatar
2 Answers
+ 1
1) Explain process 2) Temporary disable some code 3) Marker for other tools which could be run on sources, for example Doxygen
18th Jul 2017, 3:06 PM
soman
+ 1
If you've written an entire block of code that is over 10 lines, it's much easier to comment it out when you're debugging by putting a '/*' at the top and a '*/' at the bottom. There is really no special use; it all comes down to what makes it easier for you to code and comment.
19th Jul 2017, 12:51 AM
Zeke Williams
Zeke Williams - avatar