Przypisanie wartości do elementu struktury

0

Witam, mam taki szablon klasy i funkcji:

#include <iostream>
 
using namespace std;
template<typename Key, typename Info>
class Sequence//single linked lsit
{
    struct element
    {
        Key k;
        Info i;
        element *next;
    };
    element *head=0;
 
public:
    Sequence();
    ~Sequence();
    Sequence(const Sequence &x);
    void add_after(Key where, Key k1, Info i1);
    void remove_element(Key which);
    void print_list();
    int length();
    void print_element(Key which);
    Sequence operator=(const Sequence &x);
 
};
template<typename Key, typename Info>
Sequence<Key, Info> shuffle(const Sequence<Key,Info> &s1, int start1, int step1, int rep1, const Sequence<Key,Info> &s2, int start2, int step2, int rep2)
{
    Sequence<Key,Info> a=new Sequence<Key,Info>;
    element *x=s1.head;//nie działa
}

potrzebuje stworzyć element, który będzie wskazywał na głowę obiektu s1. Pomoże ktoś i podpowie jak to zrobić?

1

head jest prywatny

1 użytkowników online, w tym zalogowanych: 0, gości: 1