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
3 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
+ 1
"Comment" in C++ are not required but can be helpful for:- • Explaining code • Debugging • Organizing code • Creating to-do lists Single-line comments ("//") are best for:- • Brief notes • Disabling single lines Multi-line comments ("/* */") are best for:- • Longer explanations • Disabling larger code blocks. Hope you've got your answer........
8th Sep 2024, 10:57 AM
Sanjana
Sanjana - avatar