New course! Every coder should learn Generative AI!
Try a free lesson0
Is "comment" compulsory in C++?
is there any special use of single line comment/multi line comment....other than just explain process.
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
+ 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.