c++ query

Discussion in 'C++' started by prem_may10, Dec 22, 2006.

  1. prem_may10

    prem_may10 New Member

    Joined:
    Sep 28, 2006
    Messages:
    15
    Likes Received:
    0
    Trophy Points:
    0
    1.what is the differnce between class and structures ?

    2. what is top to bottom approach,bottom to top approach


    Thanks
    Yasodhar premchand
     
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    what is the difference between class and structures ? (I assumed you meant by C++ structure and classes and not C struct and C++ class)

    In Class by default the members/methods are private where as in struct its by default public.

    2. what is top to bottom approach,bottom to top approach ?
    It is used for parsing of code and it represent the direction in which the code is parsed.
     
  3. Aztec

    Aztec New Member

    Joined:
    May 9, 2006
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    0
    The default inheritance is public for structures and private for classes.
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    I knew I was missing the second point but could not recall on it.
     
  5. Aztec

    Aztec New Member

    Joined:
    May 9, 2006
    Messages:
    90
    Likes Received:
    0
    Trophy Points:
    0
    Here's another one:

    You can't use keyword struct in templates like template<struct T>

    Some people do not consider this as a difference. But anyways I felt like mentioning it.
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice