? is d dffrence btween C++ structure and C++ class?

This is a discussion on ? is d dffrence btween C++ structure and C++ class? within the C++ Programming forums, part of the General Programming Boards category; hi all, ? is d dffrence btween C++ structure and C++ class? pls reply........

  1. #1
    Registered User
    Join Date
    Nov 2006
    Posts
    3

    Exclamation ? is d dffrence btween C++ structure and C++ class?

    hi all,

    ? is d dffrence btween C++ structure and C++ class?

    pls reply.....

  2. #2
    Registered User
    Join Date
    Dec 2006
    Posts
    30
    by default, members of structs have public accessibility and public inheritance, and members of classes have private accessibility and private inheritance

  3. #3
    and the hat of wrongness Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    32,494
    > ? is d
    It took me far too long to figure out
    ? = what
    is = is
    d = the

    Random omission of vowels in words - did you type this on a phone or something?
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.
    I support http://www.ukip.org/ as the first necessary step to a free Europe.

  4. #4
    Its hard... But im here swgh's Avatar
    Join Date
    Apr 2005
    Location
    England
    Posts
    1,475
    In general, never use structures unless you are grouping together data that you know will only be public, and never has to be acsessed privately
    I'm just trying to be a better person - My Name Is Earl

  5. #5
    MFC killed my cat! manutd's Avatar
    Join Date
    Sep 2006
    Location
    Boston, Massachusetts
    Posts
    870
    Structures are commonly (though there is no reason for this in C++) to hold groups which have no member functions, just member variables. This is somewhat inherited from C, where it was needed.
    Silence is better than unmeaning words.
    - Pythagoras
    My blog

  6. #6
    Code Goddess Prelude's Avatar
    Join Date
    Sep 2001
    Posts
    9,796
    >It took me far too long to figure out
    >? = what
    >is = is
    >d = the
    I just skipped over it and mentally inserted the appropriate words. I guess I've gotten good at compiling lazy speak.
    My best code is written with the delete key.

  7. #7
    In the Land of Diddly-Doo g4j31a5's Avatar
    Join Date
    Jul 2006
    Posts
    476
    > I just skipped over it and mentally inserted the appropriate words. I guess I've gotten good at compiling lazy speak.

    I guess you've had your share of SMS-es, right?

    IMHO, to make it simpler struct is an all public class. All the variables and functions (if there's any) will always be public.
    ERROR: Brain not found. Please insert a new brain!

    “Do nothing which is of no use.” - Miyamoto Musashi.

  8. #8
    Just Lurking Dave_Sinkula's Avatar
    Join Date
    Oct 2002
    Posts
    5,006
    Quote Originally Posted by Amit Chikorde
    hi all,

    ? is d dffrence btween C++ structure and C++ class?

    pls reply.....
    ! 50 |)157a|\|7 7|-|0|_|9|-|75 0n 73|-| |\/|a773r
    7. It is easier to write an incorrect program than understand a correct one.
    40. There are two ways to write error-free programs; only the third one works.*

  9. #9
    Registered User
    Join Date
    Oct 2001
    Posts
    2,934
    Quote Originally Posted by Dave_Sinkula
    Dave, you are getting so good at this, it's scary.

  10. #10

  11. #11
    Ethernal Noob
    Join Date
    Nov 2001
    Posts
    1,901
    25/f/japan


    [/disguised fat man]

Popular pages Recent additions subscribe to a feed

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21