Connecting Tech Pros Worldwide Help | Site Map

virtual vs. protected

Jeremy Cowles
Guest
 
Posts: n/a
#1: Jul 19 '05
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

Victor Bazarov
Guest
 
Posts: n/a
#2: Jul 19 '05

re: virtual vs. protected


"Jeremy Cowles" <jeremy.cowles[nosp@m]asifl.com> wrote...[color=blue]
> 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%[/color]
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


Closed Thread