Jaanus
Jaanus

Reputation: 16541

Codeblocks comment out whole block

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

Answers (7)

RaspberryJamn
RaspberryJamn

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

Fazla Karim SykaT
Fazla Karim SykaT

Reputation: 51

First, select the code. After that, press Ctrl + Shift + C.

Upvotes: 3

Vishal Srivastav
Vishal Srivastav

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

Stephen Vickers
Stephen Vickers

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

user2166988
user2166988

Reputation: 251

Ctrl + Shift + C to comment selected block

Ctrl + Shift + X to uncomment .

Upvotes: 25

deek0146
deek0146

Reputation: 984

There are various functions involving that sort of thing, they're all in the Edit menu

Upvotes: 1

tdammers
tdammers

Reputation: 20721

A quick google gives me this page, which says it's Ctrl + Shift + C.

Upvotes: 13

Related Questions