Can I get an object\'s name in run time (like getting an object\'s type via RTTI)? I want the object to be able to print its name.
C++ objects don't have 'names' (unless I am understanding the problem wrong) Your best hope is to name them as you make them.
class NamedObject { String name; NamedObject(String argname) { name = argname; } } NamedObject phil("phil");