[Solved] C++ add pointers to structure


Very simply, create a class that has Uczestnik as a member variable.

struct UczestnikList {
    UczestnikList *next;
    UczestnikList *prev;
    Uczestnik val; // or Uczestnik* val;
};

Now you can use the UczestnikList and traverse through it.

Also note that val could be an embedded member variable or a pointer (Uczestnik* val) depending on how you wish to implement the list.

When you get more familiar with C++, you could use STL libraries for this, such as the doubly-linked list in std::list.

1

solved C++ add pointers to structure