What is the difference between a Structure and a Class?
Because they seem the same... Can you not place functions inside a Structure or something?
What is the difference between a Structure and a Class?
Because they seem the same... Can you not place functions inside a Structure or something?
The main difference it that a class has a constructor and a destructor a strcture does not have them also you can put functions in a class and varables you also have the abilty to make some of the varables and functions private or public in the class. That's pretty much what I know about them I bet there are lots of people on this board that can tell you more ^_^ but I hope this helps anyways
Tazar The Demon
-------------------------------------
Please check my site out at: http://www.lrs.8m.com thanks =)
-------------------------------------
Note:
I will help newbies and any other person that I can just ask I'll try to help you out =)
My MSN Messager name is: [email protected] see if I'm online maybe we can talk. =)
Structrues and Classes are basically the same execept for the syntax and the fact:
in classes
variables and functions (not OOP speak!!) are private by default.
That is why we have the keywords public and private in C++
A class would resemble a structure if all variables and functions were declared as public.
in structrues
variables and functions are public by default.
Hope this helps!!
In C++, structures and classes are the same, except structure's default data access level is public.