Follow Techotopia on Twitter

On-line Guides
All Guides
eBook Store
iOS / Android
Linux for Beginners
Office Productivity
Linux Installation
Linux Security
Linux Utilities
Linux Virtualization
Linux Kernel
System/Network Admin
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Mail Systems
Eclipse Documentation

How To Guides
General System Admin
Linux Security
Linux Filesystems
Web Servers
Graphics & Desktop
PC Hardware
Problem Solutions
Privacy Policy




Eclipse C/C++ Developer Guide
Previous Page Home Next Page

Commenting out code

You can comment out one or more lines of code. The leading characters // are added to the beginning of each line.

Tip: The characters /* */ on lines that already are already commented out are not affected when you comment and uncomment code as described above.

To comment out code:

  1. In the C/C++ editor, select the line(s) of code that you want to comment out. If no lines are selected comments will be added (or removed) at the current cursor positition.
  2. Right-click and do one of the following:
    • To comment out the selected code, select Comment.
    • To remove the leading // characters from the selected line(s) of code, select Uncomment.
Tip: Instead of using the context menu (right click) you can quickly comment out by pressing CTRL+/ or remove comments by pressing CTRL+\.

Related concepts
Code entry

Related tasks
Customizing the C/C++ editor
Working with Content Assist

Related reference
C/C++ editor preferences

IBM Copyright Statement

  Published under the terms of the Eclipse Public License Version 1.0 ("EPL") Design by Interspire