I am newbie in C++. Previously, I learnt the C language and decide to shift to learn C++ language. However, I find something hard for me to follow, particularly in using global variables. I wrote a program and I get wrong. When I tried to debug, my program show error in the line
item* list = ::array[index].head;
in which item
is
class item
{
public:
int key, data;
item* next;
};
and array
is a global variable which is define as
class arrayitem
{
public:
item* head;
item* tail;
};
arrayitem* array;