CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 14 of 14

Thread: structures

Threaded View

  1. #9
    Join Date
    Oct 2002
    Location
    Germany
    Posts
    6,205

    Talking Re: structures

    Quote Originally Posted by Andreas Masur
    Why would that be?

    In C++ there are only two differences between a class and a structure:


    • By default, the members of a class are private while the members of a structure are public
    • By default, a struct inherits publicly while a class inherits privately
    In other words...everything that a class can do, a structure can as well...
    The reason is exactly what you mentioned - in C++ (today) a struct is given all the functionalities of a class - baring defaults.

    Given this situation, perhaps, it is best to call a struct being used as a class, a class.
    Last edited by Siddhartha; April 23rd, 2005 at 03:57 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured