Reputation: 16541
I am using a Codeblocks IDE for C++ and I tried googling it, but could not find the answer.
How do I comment out a block of code in Codeblocks? For example in Eclipse its ctrl+7.
Upvotes: 15
Views: 44121
Reputation: 1
Codeblocks has the functionality for toggle commenting a block of selected text, but by default it isn't bound to the conventional Ctrl+/
You can add a binding by going to Settings>Editor, scrolling down to "Keyboard shortcuts", Menu bar>Edit>Toggle comment, and in the "New shortcut" box pressing Ctrl and /
Upvotes: 0
Reputation: 51
First, select the code. After that, press Ctrl + Shift + C
.
Upvotes: 3
Reputation: 603
Shortcut to Comment highlighted code: Ctrl + Shift + C
Shortcut to Uncomment highlighted code: Ctrl + Shift + X
By the way, You can go with this link and you can search whatever shortcut you want in codeblocks.
Upvotes: 6
Reputation: 51
You can do a box comment with /*
at the start and */
at the end. It'll block out everything in between.
i.e.
/*This is part of a block comment.
This is still part of it
This also part of it */
If you just highlight the code you want to comment out and go to Edit --> Box-Comment. It'll do it all for you.
Upvotes: 5
Reputation: 251
Ctrl + Shift + C to comment selected block
Ctrl + Shift + X to uncomment .
Upvotes: 25
Reputation: 984
There are various functions involving that sort of thing, they're all in the Edit menu
Upvotes: 1