+ 1
The difference b/w single line comment & multi line comment.?
2 ответов
+ 4
My problem with multi-line comments is people do forget to close them or delete the close accidentally. Then, code will not run as it is within a bigger comment. That can't happen with single line comments. They automatically close at the end of the line.
int x = 5;
/*
Example comment
x += 2;
/*
Second comment
*/
// x is still 5, but a quick look might convince you it is 7. I've spent many hours tracking down these types of errors.
0
Single line comment you have to comment every line but don't have to close the comment.
Multi line comment you open and close a block of lines within your comment.