help-gplusplus
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Obtaining the name of the C++ class from the pointer


From: Andreas Schallenberg
Subject: Re: Obtaining the name of the C++ class from the pointer
Date: Mon, 01 May 2006 20:49:39 +0200
User-agent: KNode/0.10.2

Is this ok for you:

#include <typeinfo>
#include <iostream>

...
// having any ptr around
X * ptr;
...
cout << "type is " << typeid(*ptr).name() << endl;
...

Or are you looking for something different?

RU,
Andreas


reply via email to

[Prev in Thread] Current Thread [Next in Thread]