Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > inheritance, pointercast

Reply
Thread Tools

inheritance, pointercast

 
 
Rasmus
Guest
Posts: n/a
 
      07-29-2003
Hi, here a quick question:

I have class A,B,C where B and C is extended from A.

I would like to construct A objects like:

A *a3 = new A(a1, a2);

and a3 should be an object of type B or C.

Is this possible?
| true: How?
| false: Can you give me a nice solution?

Thanks for your time
Rasmus





 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
inheritance, pointercast Dan Cernat C++ 0 07-31-2003 12:47 PM



Advertisments