1. Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members.

Classes & Structure

Discussion in 'Software Development' started by handshakeit, Jan 23, 2006.

Thread Status:
Not open for further replies.
Advertisement
  1. handshakeit

    handshakeit Thread Starter

    Joined:
    Oct 4, 2005
    Messages:
    9
    hi friends...
    comment on it.
    All opreations of classes can be performed on structure using Turbo c++ complier. Well tell me d difference.
    Thanx
    Devs
     
  2. jiml8

    jiml8 Guest

    Joined:
    Jul 2, 2005
    Messages:
    2,634
    A structure is an organized set of data. A class is an organized set that includes both data and functions (methods).
     
  3. RGregory

    RGregory

    Joined:
    Jul 27, 2005
    Messages:
    65
    You can have methods in structures also (though I don't know why anybody would want to). The main difference between structures and classes is that:

    1. Items in structures are PUBLIC by default.
    2. Items in classes are PRIVATE by default.

    Still, I would agree with the previous user, that classes are used in the programming community to contain both member variables and methods, whereas structures are used to only hold data variables.
     
  4. AGCurry

    AGCurry

    Joined:
    Jun 15, 2005
    Messages:
    431
    As a plain-old-C programmer, I've been coding pointers to functions in structures for years.

    The class is just an implementation of the structure with another layer of abstraction.
     
As Seen On
As Seen On...

Welcome to Tech Support Guy!

Are you looking for the solution to your computer problem? Join our site today to ask your question. This site is completely free -- paid for by advertisers and donations.

If you're not already familiar with forums, watch our Welcome Guide to get started.

Join over 733,556 other people just like you!

Thread Status:
Not open for further replies.

Short URL to this thread: https://techguy.org/436455

  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