0
Is "comment" compulsory in C++?
is there any special use of single line comment/multi line comment....other than just explain process.
3 Antworten
+ 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.
+ 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........