Computer Science Canada Sub Structure ? ? ? ! ! ! |
Author: | Homer_simpson [ Fri Jul 25, 2003 6:52 pm ] |
Post subject: | Sub Structure ? ? ? ! ! ! |
ok i know that classes can have subclasses and u can use virtual to run specific function that specific subclass has... but is there such a thing for structures as well? |
Author: | UBC_Wiskatos [ Fri Jul 25, 2003 9:27 pm ] |
Post subject: | Re: Sub Structure ? ? ? ! ! ! |
Homer_simpson wrote: ok i know that classes can have subclasses and u can use virtual to run specific function that specific subclass has... but is there such a thing for structures as well?
A structure is the same as a class in C++, except that a structure's members default to public, while a class' members default to private. You can use them interchangably if you wish. Also, classes default to inheriting privately, while structures default to inheriting publically. |