Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!usc!ucsd!pacbell.com!pacbell!att!mcdchg!chinet!patrickd From: patrickd@chinet.chi.il.us (Patrick Deupree) Newsgroups: comp.lang.c++ Subject: Re: Passing class name as argument? Keywords: persistency Message-ID: <1990Aug30.145049.2850@chinet.chi.il.us> Date: 30 Aug 90 14:50:49 GMT References: Distribution: na Organization: Chinet - Chicago Public Access UNIX Lines: 26 In article rgonzal@elbereth.rutgers.edu (Ralph Gonzalez) writes: > void *Persistent::get_class(void) > { > return Persistent; > } > >Neat, eh? Now, in C++ this gives a syntax error. My question is: Is >there any way of passing class names like this in C++??????????? The way things are done in Turbo C++ is that there is a file called "clstypes.h". Inside of this file is a table of definitions that looks something like: #define objectClass 0 #define containerClass objectClass+1 etc... This is the way that a class type is passed back. This class is passed back in a method (member function) called isA. There is also a member function called nameOf that will pass back a string representation of the class name. -- "What's in a name? That which we call a rose by any other name would smell as sweet." William Shakespeare Patrick Deupree -> patrickd@chinet.chi.il.us (708) 328-3800 (Please note there are both a patrick and a patrickd at this site)