View Single Post
Old Jan 2nd, 2007, 4:36 AM   #2
bl00dninja
Programming Guru
 
bl00dninja's Avatar
 
Join Date: Oct 2004
Location: namespace std
Posts: 1,246
Rep Power: 6 bl00dninja is on a distinguished road
the whole 'point' of a void pointer is to point to an object of unknown type at run-time, rather than compile-time. this is usually done with polymorphism (one thingie can be one of many thingies). the simple example can be animal sounds.

you start your program with several classes, all inheriting from the abstract class animal. it has a pure virtual function known as sound, (denoted by function_name() = 0) which has the property of echoing the animal sounds by those which the user has decided upon. we use a switch @ run-time to find out which animal sound we should make!

if this doesn't make sense, read up on c++ and polymorphism.

good luck!
__________________
i put on my robe and wizard hat...

Have you ever heard of Plato, Aristotle, Socrates?...Morons.
bl00dninja is offline   Reply With Quote