List of pointers in C ++
What I want to do is
for (list<cPacket *>::iterator i = cache.begin(); i != cache.end(); i++){
if( strcmp(i->getName(),id) == 0 ){
return true;
}
}
where getName
is a function of the cPacket class but it doesn't work, I also try
i.operator->()->getName()
, and again nothing.
Can anyone help me?
+2
source to share