2003-11-28 21:50:02 +00:00
<!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 > Commenting out code< / title >
< link rel = "stylesheet" type = "text/css" href = "../help.css" >
< / head >
< body >
< h1 > Commenting out code< / h1 >
2010-05-09 17:11:10 +00:00
< p > You can comment out one or more lines of code in any C/C++ editor view.
The leading characters < samp > //< / samp > are added to the beginning of each line when commenting one or more lines of code.
You can also block comment multiple lines of code using the characters < samp > /* */< / samp > .< / p >
2003-11-28 21:50:02 +00:00
2010-03-31 01:34:27 +00:00
< p > < strong > Tip:< / strong > The characters < samp > /* */< / samp > on lines that already are
2003-11-28 21:50:02 +00:00
already commented out are not affected when you comment and uncomment code as
described above.< / p >
2010-05-09 17:11:10 +00:00
< p > < img src = "../images/cdt_menu_toggle_comments.png" alt = "Commenting out code menu choices" > < / p >
< p > To toggle < samp > //< / samp > comments on code:< / p >
2003-11-28 21:50:02 +00:00
< ol >
2010-05-09 17:11:10 +00:00
< li > 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 position.< / li >
< li > Right-click and select < strong > Source > Toggle Comment< / strong > . (< samp > CTRL+/< / samp > )< / li >
2003-11-28 21:50:02 +00:00
< / ul >
2004-06-21 10:33:03 +00:00
< / ol >
2010-05-09 17:11:10 +00:00
< p > To block comment < samp > /* */< / samp > code:< / p >
< ol >
< li > In the C/C++ editor, select multiple line(s) of code to comment out.< / li >
< li > To comment out multiple code lines right-click and select < strong > Source > Add Block Comment< / strong > . (< samp > CTRL+SHIFT+/< / samp > )< / li >
< li > To uncomment multiple code lines right-click and select < strong > Source > Remove Block Comment< / strong > . (< samp > CTRL+SHIFT+\< / samp > )< / li >
< / ul >
< / ol >
2003-11-28 21:50:02 +00:00
< p > < img border = "0" src = "../images/ngconcepts.gif" ALT = "Related concepts" width = "143" height = "21" >
< br >
< a href = "../concepts/cdt_o_code_entry.htm" > Code entry< / a > < / p >
< p > < img border = "0" src = "../images/ngtasks.gif" ALT = "Related tasks" width = "143" height = "21" >
< br >
< a href = "cdt_t_cust_cpp_editor.htm" > Customizing the C/C++ editor< / a > < br >
< a href = "cdt_o_con_assist.htm" > Working with Content Assist< / a > < / p >
< p > < img border = "0" src = "../images/ngref.gif" ALT = "Related reference" width = "143" height = "21" >
< br >
2007-12-05 12:28:32 +00:00
< a href = "../reference/cdt_o_ceditor_pref.htm" > C/C++ editor preferences< / a > < / p >
2010-05-10 20:25:24 +00:00
< hr >
2004-06-24 10:49:13 +00:00
< img src = "../images/ng00_04a.gif" ALT = "IBM Copyright Statement" >
2003-11-28 21:50:02 +00:00
< / body >
< / html >