Originally Posted by
Mario F.
Because the list is now shortened and start and end remained the same?
Ok, here's the whole class and the 'Elem' stuct:
Code:
class List
{
int ID_j2rg;
Elem start, end;
public:
List();
void push_front(const int&);
void push_back(const int&);
void add_after(const Iterator&, const int value);
void add_after(const int, const int);
void view(bool mode = 0); //kui mode = 0, siis edaspidi, kui 1 siis tagurpidi
List bond(List&);
List cut(Iterator&);
Elem* get_begin() { return &start; }
Elem* get_end() { return &end; }
};
struct Elem
{
struct Elem* prev, *next;
int value;
int ID;
Elem() { value = 0; ID = -1; prev = next = NULL; }
Elem(const int& a, const int new_id) { value = a; ID = new_id; prev = next = NULL; }
};