Commenting Lines in Your Code

To change one or more lines of code to comments:

  1. Select the lines you want to change to comments.
  2. Click the Comment button in the editor toolbar or type Ctrl+Shift+T.

In C++ code, // is added at the beginning of the selected lines. In C code, /* is added before the first selected line, and */ is added after the last selected line.

To change the commented lines back to code:

  1. In a C file, place your cursor with the commented block of code. In a C++ file, select all the lines you want to uncomment.
  2. Click the Uncomment button in the editor toolbar or type Ctrl+Shift+D.

Copyright © 2015, Oracle and/or its affiliates. All rights reserved.