Eclipse: comment on all the code without going around it with another comment

Let's say I have the following code (in C ++, but this is probably not important for the question):

int main() {
    ....random code....
    /*This is a comment*/
    ....random code....
    return 0;
}

In eclipse, when I want to comment on all the code by putting / * and * / before and after the code, the comment will be interrupted * / at the end of “This is a comment” on line 3, so the rest of the code is left without comment.

/*    //<--overall comment starts here
int main() {
    ....random code....
    /*This is a comment*/    //<--overall comment ends here
    ....random code....
    return 0;
}
*/  //<--overall comment SHOULD end here

Does anyone know a way around this problem, or do I just need to deal with it or use // comments ...?

+4
source share
1 answer

++ . ( /* */ //) - , -

#ifdef SOME_RANDOM_SYMBOL

code that you want to comment here

#endif

, SOME_RANDOM_SYMBOL - .

@Caleb ,

#if 0

code that you want to comment here

#endif

.

+6

Source: https://habr.com/ru/post/1670111/


All Articles