C++ structures in Class Designer

Applies to: yesVisual Studio noVisual Studio for Mac

Note

This article applies to Visual Studio 2017. If you're looking for the latest Visual Studio documentation, see Visual Studio documentation. We recommend upgrading to the latest version of Visual Studio. Download it here

Class Designer supports C++ structures, which are declared with the keyword struct. Following is an example:

struct MyStructure
{
   char a;
   int i;
   long j;
};

For more information about using the struct type, see struct.

A C++ structure shape in a class diagram looks and works like a class shape, except that the label reads Struct and it has square corners instead of rounded corners.

Code element Class Designer view
struct StructureName {}; StructureName

Struct

See also