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
Programming
Scripting Languages
Development Tools
Web Development
GUI Toolkits/Desktop
Databases
Mail Systems
openSolaris
Eclipse Documentation
Techotopia.com
Virtuatopia.com
Answertopia.com

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

  




 

 

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

Comments

Comments are lines in a source file that have been marked to be ignored by the compiler. Two styles of comments are supported by current C/C++ compilers:

  • /* text */
  • // text

Comment

You can quickly comment out one or more lines of code by inserting the leading characters // at the beginning of the line. To do so, select the line (or lines) of code you want to comment out and press CTRL+/ (slash).

Uncomment

To uncomment select the line (or lines) of code, and press CTRL+\ (backslash).

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

Multiline comment

You can use the Content Assist feature to insert a multi-line comment before a function. Type com+Ctrl+Space, and the following code is entered at the cursor location:

/*
 * author userid
 *
 * To change this generated comment edit the template variable "comment":
 * Window > Preferences > C/C++ > Editor > Templates.
 */
 
To change the default comment click Window > Preferences > C > Templates. For more information see the Content Assist section.

Related concepts
Content Assist and code completion

Related tasks
Customizing the C++ editor
Commenting out code

Related reference
C/C++ editor preferences

Red Hat Copyright Statement
 IBM Copyright Statement


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