Search:
Forum
Beginners
object of a baseClass referenced to a de
[try Beta version]
Not logged in
register
log in
user name:
password:
remember me
forgot your password?
or sign in using:
try again
cancel
forgot your password?
object of a baseClass referenced to a derived class
Oct 4, 2014 at 9:55pm
Oct 4, 2014 at 9:55pm UTC
Sharan123
(352)
what is the difference between
BaseClass Base=
new
DerivedClass()
AND
BaseClass Base=
new
BaseClass()
Oct 4, 2014 at 10:00pm
Oct 4, 2014 at 10:00pm UTC
MiiNiPaa
(8886)
You probably meant
BaseClass* Base
The difference is that in first case pointer will actually point to the derived object and virtual function will be executed based on real type of the object.
Topic archived. No new replies allowed.
C++
Information
Tutorials
Reference
Articles
Forum
Forum
Beginners
Windows Programming
UNIX/Linux Programming
General C++ Programming
Lounge
Jobs