代码块注释掉整个块
我正在使用 C++ 的 Codeblocks IDE,我尝试用谷歌搜索它,但找不到答案。
如何注释掉 Codeblocks 中的代码块? 例如在 Eclipse 中是 ctrl+7。
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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(7)
Ctrl + Shift + C 注释所选块
Ctrl + Shift + X 取消注释。
Ctrl + Shift + C to comment selected block
Ctrl + Shift + X to uncomment .
快速谷歌搜索给我此页面,上面写着 Ctrl + Shift + C。
A quick google gives me this page, which says it's Ctrl + Shift + C.
您可以在开头使用
/*
并在结尾使用*/
进行框注释。它会挡住中间的一切。即,
如果您只是突出显示要注释掉的代码并转到“编辑”-->框评论。它会为你做这一切。
You can do a box comment with
/*
at the start and*/
at the end. It'll block out everything in between.i.e.
If you just highlight the code you want to comment out and go to Edit --> Box-Comment. It'll do it all for you.
注释突出显示代码的快捷方式:
Ctrl + Shift + C
取消注释突出显示代码的快捷方式:
Ctrl + Shift + X
顺便说一下,您可以使用 此链接,您可以在代码块中搜索您想要的任何快捷方式。
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.
首先,选择代码。之后,按
Ctrl + Shift + C
。First, select the code. After that, press
Ctrl + Shift + C
.有各种涉及此类事情的功能,它们都在“编辑”菜单中
There are various functions involving that sort of thing, they're all in the Edit menu
Codeblocks 具有切换注释选定文本块的功能,但默认情况下它不绑定到传统的 Ctrl+/
您可以通过转到“设置”>“编辑器”,向下滚动到“键盘快捷键”,菜单栏>“编辑”来添加绑定;切换注释,并在“新快捷方式”框中按 Ctrl 和 /
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 /