<snip>
>       Are you sure structures arent a part of C++ too?
>       My teacher has planed a 4h class on structures.
>       Wich one is better? classes or Structures?
</snip>

structures are definately part of C++.

You can't really say which is "better" or "worse", each
has it's own unique set of abilities...

Data Protection in classes is available, and the methods which
call them can be included in the class as well, there by allowing
for encapsulation.

Structs in the most general of senses allow for a grouping of multiple
data values into a single data type.  Sure, they can have methods
attached to them as well, however, when it comes to attaching methods,
a class would be better.

I've prolly confused the hell outta ya....  And I'm sorry for it, but to make it
simple, here is the guideline I use:

Stucture - When you need a new data-type as a collection

Class - When the data is to be modified by a specific set of methods, or
        when data-protection is a key issue.

Hope this helps in your quest, best of luck...

--
Jamie Harrell               |  [EMAIL PROTECTED]
                                  |  URL: http://icechild.dhs.org
ICQ: 2985611              |  AIM: Liquidicie
--
"A computer scientist is someone who, when told to 'Go to Hell',
            sees the 'go to', rather than the destination, as harmful."
--



Reply via email to