Adding fields to C/C++ classes and data types

In class diagrams, you can add fields to C/C++ classes and data types.
You must be in the C/C++ perspective and have a class diagram open in the diagram editor.
To add a field to a C/C++ class or data type:
  1. In the diagram editor, right-click a C/C++ class or data type; then click Add C/C++ > Field.
  2. In the Create C/C++ Field wizard, in the Type field, specify a type from the list.
  3. In the Name field, type a name for the new field.
  4. In the Access Visibility field, specify an access type.
  5. If the field is a static type, select the static check box.
  6. If the field can be modified, select the mutable check box.
  7. Click Finish.

If applicable, the include directives for the type of field are added to the include file automatically.

Tip: You can also use the action bar to add fields to C/C++ classes and data types.
Related concepts
Attributes
Operations in UML class diagrams
Related tasks
Creating C/C++ classes
Modifying C/C++ classes or data types
Adding methods to C/C++ classes and data types
Changing the visibility of C/C++ fields and methods
Changing the type for C/C++ fields in diagrams
Changing the return type for C/C++ methods in diagrams
Refactoring inline
Creating C/C++ enumerations
Adding enumeration literals to C/C++ enumerations
Deleting C/C++ elements from diagrams
Deleting C/C++ elements from projects
Renaming C/C++ elements
Creating relationships between C/C++ elements

Feedback