Oracle® Solaris Studio 12.4: IDE Quick Start Tutorial

Exit Print View

Updated: October 2014
 
 

Using Pair Completion

When you edit your C and C++ source file, the Source Editor does “smart” matching of pair characters such as brackets, parentheses, and quotation marks. When you type one of these characters, the Source Editor automatically inserts the closing character.

  1. In the Quote_1 project, place the cursor after the { on line 116 of the module.cc file and press Return to open a new line.

  2. Type enum state { and press Return. The closing curly bracket and the semi-colon are added automatically and the cursor is placed between the brackets.

  3. Type invalid=0, success=1 to complete the enumeration.

  4. On the line after the closing }; of the enumeration, type if (. The closing parenthesis is added automatically and the cursor is placed between the parentheses.

  5. Type v==null. Then type i and newline after the right parenthesis. The closing bracket is added automatically.

  6. Delete the code you have added.