This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Re: class member access denied
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
>>>>> "Mauro" == Mauro Pisano <mpisano@ed.gba.gov.ar> writes:
Mauro> So, I define an array of pointers to a base class, then ,
Mauro> assign each pointer a derived class, but, I can't acces to
Mauro> member of the derived class ?
Yes, indeed. You need to cast the pointer or dereferenced pointer to
its appropriate type. Also have a look at typeid, dynamic_cast,
static_cast etc.
Mauro> I'm compiling this with a Microsoft C++ Compiler.
???
# gcc-help is a relatively high volume list for people searching for
help in building or using GCC.
^^^
Claudio
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: Processed by Mailcrypt 3.5.6 <http://mailcrypt.sourceforge.net/>
iD8DBQE88o78TpSishmp0ioRAlRFAJ9M8xQRmp4kBvD5MReNMJoElcUjzgCgkp8O
MZ7GVWCkhuPtGmzNFrIZ+r8=
=MoAQ
-----END PGP SIGNATURE-----