Using Code Templates to insert snippets
To add a Code Template
- On the Window menu, click Preferences. The Preferences dialog box opens.
- In the left pane, expand C/C++ and click Code Templates.
- Click New. The New Template dialog box opens.
Do the following
- In the Name field, enter a template name.
- In the Description field, enter a template description.
- In the Pattern field, enter the code for your template.
- Click the Context button and select a template type: C or C++.
- Click OK.