CList problem

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Can some tell me how to use a CList with a struct data type? As it is this
seems to work fine, but I can't seem to figure out how to access the data in
the struct in the list such age and name from the list. Can someone give me
a clue. I thought using CList would be easier and faster than implementing
a standard Linklist using C++ pointers, but maybe that was a mistake on my
part since I can't seem to make this work.


Z.K.


struct PERSON
{
int age;
CString name;
}


PERSON tom;

tom.age = 27;
tom.name = "Thomas";

CList<PERSON, PERSON> list;

POSITION pos = list.AddHead(tom);



.



Relevant Pages