Click here to Skip to main content
15,902,938 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: Polymorphic pointer points to what? Pin
Stephen Hewitt17-May-06 14:04
Stephen Hewitt17-May-06 14:04 
GeneralRe: Polymorphic pointer points to what? Pin
Cedric Moonen17-May-06 21:26
Cedric Moonen17-May-06 21:26 
GeneralRe: Polymorphic pointer points to what? Pin
Stephen Hewitt18-May-06 0:52
Stephen Hewitt18-May-06 0:52 
GeneralRe: Polymorphic pointer points to what? Pin
Cedric Moonen18-May-06 1:52
Cedric Moonen18-May-06 1:52 
GeneralRe: Polymorphic pointer points to what? Pin
Stephen Hewitt18-May-06 2:42
Stephen Hewitt18-May-06 2:42 
GeneralRe: Polymorphic pointer points to what? Pin
Cedric Moonen18-May-06 2:58
Cedric Moonen18-May-06 2:58 
GeneralRe: Polymorphic pointer points to what? Pin
Stephen Hewitt18-May-06 3:44
Stephen Hewitt18-May-06 3:44 
AnswerRe: Polymorphic pointer points to what? Pin
Sarath C17-May-06 1:23
Sarath C17-May-06 1:23 
HI,
u can use typeid operator for checking
for this u have to enable the Run Time Type Identification from Project options.
the following code snippet explain the operation

using dynamic_cast operator also u can accomplish this.

// expre_typeid_Operator.cpp
// compile with: /GR /EHsc
#include <iostream>
#include <typeinfo.h>

class Base {
public:
virtual void vvfunc() {}
};

class Derived : public Base {};

using namespace std;
int main()
{
Derived* pd = new Derived;
Base* pb = pd;
cout << typeid( pb ).name() << endl; //prints "class Base *"
cout << typeid( *pb ).name() << endl; //prints "class Derived"
cout << typeid( pd ).name() << endl; //prints "class Derived *"
cout << typeid( *pd ).name() << endl; //prints "class Derived"
delete pd;
}


-Sarath
GeneralRe: Polymorphic pointer points to what? Pin
Cedric Moonen17-May-06 1:37
Cedric Moonen17-May-06 1:37 
GeneralRe: Polymorphic pointer points to what? Pin
markkuk17-May-06 3:18
markkuk17-May-06 3:18 
GeneralRe: Polymorphic pointer points to what? Pin
Cedric Moonen17-May-06 3:46
Cedric Moonen17-May-06 3:46 
AnswerRe: Polymorphic pointer points to what? Pin
Sarath C17-May-06 1:35
Sarath C17-May-06 1:35 
QuestionRe: Polymorphic pointer points to what? Pin
David Crow17-May-06 3:13
David Crow17-May-06 3:13 
AnswerRe: Polymorphic pointer points to what? Pin
SimonSays17-May-06 10:47
SimonSays17-May-06 10:47 
GeneralRe: Polymorphic pointer points to what? Pin
G_urr_A17-May-06 11:49
G_urr_A17-May-06 11:49 
GeneralRe: Polymorphic pointer points to what? Pin
G_urr_A17-May-06 13:14
G_urr_A17-May-06 13:14 
GeneralRe: Polymorphic pointer points to what? Pin
Stephen Hewitt17-May-06 13:52
Stephen Hewitt17-May-06 13:52 
QuestionWSAGetLastError() 10061 with connect() Pin
Just Baballa17-May-06 1:12
Just Baballa17-May-06 1:12 
JokeRe: WSAGetLastError() 10061 with connect() Pin
RicoH17-May-06 4:11
RicoH17-May-06 4:11 
QuestionRegarding timers Pin
Raja Bose C Leo17-May-06 1:04
Raja Bose C Leo17-May-06 1:04 
AnswerRe: Regarding timers Pin
Cedric Moonen17-May-06 1:11
Cedric Moonen17-May-06 1:11 
AnswerRe: Regarding timers Pin
Sarath C17-May-06 1:15
Sarath C17-May-06 1:15 
GeneralRe: Regarding timers Pin
Raja Bose C Leo17-May-06 2:06
Raja Bose C Leo17-May-06 2:06 
QuestionCScrollView client area update child controls Pin
NovativeDesign17-May-06 1:02
NovativeDesign17-May-06 1:02 
QuestionA difficult question for me to resolve about C++ and Access datetime type Pin
fyr00000017-May-06 0:57
fyr00000017-May-06 0:57 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.