mirror of
https://github.com/eclipse-cdt/cdt
synced 2025-04-23 14:42:11 +02:00
66 lines
No EOL
2.4 KiB
HTML
66 lines
No EOL
2.4 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
|
|
<html lang="en">
|
|
|
|
<head>
|
|
<meta http-equiv="Content-Language" content="en-us">
|
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
|
<title>Comments</title>
|
|
<link rel="stylesheet" type="text/css" href="../help.css">
|
|
</head>
|
|
|
|
<body>
|
|
|
|
<h1>Comments</h1>
|
|
<p>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:</p>
|
|
<ul>
|
|
<li><samp>/* text */</samp></li>
|
|
<li><samp>// text</samp></li>
|
|
</ul>
|
|
|
|
<h3>Comment</h3>
|
|
<p>You can quickly comment out one or more lines of code by inserting the leading
|
|
characters <samp>//</samp> at the beginning of the line. To do so, select the line
|
|
(or lines) of code you want to comment out and press <b>CTRL+/</b> (slash).</p>
|
|
|
|
<h3>Uncomment</h3>
|
|
<p>To uncomment select the line (or lines) of code, and press <b>CTRL+\</b>
|
|
(backslash).
|
|
|
|
<p><b>Tip:</b> The characters <samp>/* */</samp> on lines that are
|
|
already commented out, are not affected when you comment and uncomment code.</p>
|
|
|
|
<h3>Multiline comment</h3>
|
|
<p>You can use the Content Assist feature to insert a multi-line comment before a function.
|
|
Type <tt>com+Ctrl+Space</tt>, and the following code is entered at the cursor location:
|
|
<br><pre>
|
|
/*
|
|
* author userid
|
|
*
|
|
* To change this generated comment edit the template variable "comment":
|
|
* Window > Preferences > C/C++ > Editor > Templates.
|
|
*/
|
|
</pre>
|
|
|
|
To change the default comment click <b>Window > Preferences > C > Templates</b>. For more information see the
|
|
<a href="cdt_c_content_assist.htm">Content Assist</a> section.
|
|
|
|
<p><img border="0" src="../images/ngconcepts.gif" ALT="Related concepts" width="143" height="21">
|
|
<br>
|
|
<a href="cdt_c_content_assist.htm">Content Assist and code completion</a></p>
|
|
<p><img border="0" src="../images/ngtasks.gif" ALT="Related tasks" width="143" height="21">
|
|
<br>
|
|
<a href="../tasks/cdt_t_cust_cpp_editor.htm">Customizing the C++ editor</a><br>
|
|
<a href="../tasks/cdt_t_comment_out.htm">Commenting out code</a></p>
|
|
<p><img border="0" src="../images/ngref.gif" ALT="Related reference" width="143" height="21">
|
|
<br>
|
|
<a href="../reference/cdt_o_ceditor_pref.htm">C/C++ editor preferences</a></p>
|
|
|
|
<p>
|
|
<img src="../images/rh03_04.gif" ALT="Red Hat Copyright Statement"><br>
|
|
<img src="../images/ng00_04a.gif" ALT=" IBM Copyright Statement" >
|
|
</p>
|
|
|
|
</body>
|
|
|
|
</html> |