C++ “multi-line” comment format

how do you use the C++ “multi-line” comment format?
1
2
3
4
5
6
7
/*
Everything in this 
paragraph is a comment.

Multi line comments cannot be nested.

*/
and it goes above the function ?
what do you mean by above the function?

It goes any where you want to comment.
shadowCODE is right, but just to add: for purposes of putting it "above the function", yes, you'll often see the multi-line comments like that above function declarations, to explain what they do, usually in a header file (the "interface") for multi-file projects.

Also, another little thing: if, for some reason, you need a large section of compile-able code to be cut-off, but these sections have /* */-style comments in them, you can use the preprocessor
1
2
3
4
5
#if 0
//code
 ... /* other comments */
//code
#endif 

Last edited on
Topic archived. No new replies allowed.