By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,231 Members | 1,779 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,231 IT Pros & Developers. It's quick & easy.

virtual vs. protected

P: n/a
In VB you have Protected & Overridable, which mean, "visible/callable only
to derrived classes", and "derrived classes may override/replace",
respectfully. Is that roughly the same as protected and virtual in C++? I
have read the definition in VC++ help, but I just want to be 100% positive.
Thanks,
Jeremy

Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
"Jeremy Cowles" <jeremy.cowles[nosp@m]asifl.com> wrote...
In VB you have Protected & Overridable, which mean, "visible/callable only
to derrived classes", and "derrived classes may override/replace",
respectfully. Is that roughly the same as protected and virtual in C++? I
have read the definition in VC++ help, but I just want to be 100%

positive.

"protected" access specifier makes the members visible only
to self, to friends, and to derived classes.

"virtual" specifier means it's a special function utilising
run-time type of the object. Virtual functions are known as
"dynamically bound".

I am not sure what it corresponds to in VB, but sounds like
you've found a very close match. Keep in mind that when
different languages are concerned, you can never be "100%
positive".

Victor
Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.