Advertisement

typeinfo / specifficaly typeid

Started by May 18, 2001 09:24 AM
-1 comments, last by TheHermit 23 years, 8 months ago
Using C++, on unix through g++ I need some info on how to use the typeid() function. Any website indications would be great. specifically, i have class b and c, which are both derived from class a. in my main program, I use an iterator for a vector of a* to traipse the list, and i believe if (typeid(*iter) == typeid(b)) {...} else {other stuff) should pick out the objects of type b. The iterator is pointing to the right objects, (checked with a display() funct, I have included the typeinfo lib. always with b objects, other stuff is done instead of ...

This topic is closed to new replies.

Advertisement