简体   繁体   中英

UML Class diagram C++ struct

How can I show struct members in the UML class diagram. In class diagram, I added struct as attribute and don't know how to add 'x', 'next' elements to that struct. if I generate the C++ from class diagram, it should have 'x' and 'next' elements in struct.

 class LinkList
    {
    private:
      // how to show the struct and its members in UML class diagram
      struct node
      {
         int x;
         node *next;
      }*p;

    public:
      // add an element
      void append(int num);

     // counts number of elements
      int count();
    };

something like this?! 在此处输入图片说明

and you would just remove the <<ptr>> stereotype and use the * as well, like +next:node*

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM