如何在UML类图中展示结构体成员。在类图中,我将结构体作为属性添加进去了,但不知道如何添加 'x'、'next' 元素到该结构体中。如果从类图中生成 C++ 代码,那么结构体应该有 'x' 和 'next' 元素。
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();
};