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

Threaded View

  1. #9
    Join Date
    Jan 2006
    Location
    Singapore
    Posts
    6,765

    Re: struct questions.

    The only difference between class and struct is:

    Member of classes are private by default.
    Member of structs are public by default.

    If you read any other differences - it's a core crap!
    No, Plasmator is correct. The C++ Standard states: "A structure is a class defined with the class-key struct; its members and base classes are public by default."

    Thus, another difference between classes and structs is that classes use private inheritance by default and structs use public inheritance by default.

    Oh, and then there are the trivial differences like difference in spelling between "class" and "struct"
    Last edited by laserlight; May 17th, 2008 at 02:17 AM.
    C + C++ Compiler: MinGW port of GCC
    Build + Version Control System: SCons + Bazaar

    Look up a C/C++ Reference and learn How To Ask Questions The Smart Way
    Kindly rate my posts if you found them useful

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