Results 1 to 13 of 13

Thread: c++

  1. #1

    Thread Starter
    New Member
    Join Date
    Nov 2001
    Posts
    1

    c++

    What is class?

  2. #2
    New Member
    Join Date
    Nov 2001
    Location
    chicago
    Posts
    1
    not so sure

  3. #3
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092
    A class is an object that contains items of data as well as operations/functions that can be performed on that data.

    boogal1
    aaa

    Both registered today, both with 1 post each and the reply posted only minutes after the original post. Is this a case of multiple personalities? or simply someone as bored as me with nothing better to do?

  4. #4
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Originally posted by Fishcake

    boogal1
    aaa

    Both registered today, Is this a case of multiple personalities?
    LOL, I think you are right. He wanted to increase the post count for both of his users;0
    Baaaaaaaaah

  5. #5
    Originally posted by abdul
    LOL, I think you are right. He wanted to increase the post count for both of his users;0
    Sounds familiar, doesn't it?

  6. #6
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    A class is a type of object, defining its contents and methods related to it, a class is the fundamental part of a paradigm called Object Oriented Programming (OOP) which allows data to be encapsulated and protected from misusage, furthermore object orientation provides inheritance which means grouping classes into a hierarchic structure and polymorphism which means that objects can act in many ways by inheriting special abstract forms. It's very important to learn OOP at an early stage in C++ since you'll be depending on it to produce applications efficiently.
    Check out the tutorials at the top of this forum
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

  7. #7
    Addicted Member
    Join Date
    Aug 2001
    Location
    I'm mobile
    Posts
    166
    kedaman,

    by using structures in an early stage of learning c++ & OOP, do you easier understand classes later?

    Isn't structures quite like classes in some ways?
    I don't know........

    thanks
    [p r a e t o r i a n]

  8. #8
    PowerPoster abdul's Avatar
    Join Date
    Dec 2000
    Location
    Ontario,Canada
    Posts
    2,827
    Originally posted by [praetorian]
    kedaman,

    by using structures in an early stage of learning c++ & OOP, do you easier understand classes later?

    Isn't structures quite like classes in some ways?
    I don't know........

    thanks
    Classes and Structures are related to each other but in their basic stages. It means that structure is like a record that can hold different types of information. Other the other hand, a class is a record and also an object that can hold different kinds of information (properties) and it can also have some actions (functions) for its object. So, a class is kinda like an advanced and different structure.
    Baaaaaaaaah

  9. #9
    Addicted Member
    Join Date
    Aug 2001
    Location
    I'm mobile
    Posts
    166

    Wink

    Ok, then I understand better.

    thanks

    [p r a e t o r i a n]

  10. #10
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    In C++, a struct is simply a class where all the members are public by default (rather than private as in a class).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  11. #11
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    which already shows just how nearly related they are...
    All the buzzt
    CornedBee

    "Writing specifications is like writing a novel. Writing code is like writing poetry."
    - Anonymous, published by Raymond Chen

    Don't PM me with your problems, I scan most of the forums daily. If you do PM me, I will not answer your question.

  12. #12
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Yep, but they're implemented differently, so you need to be careful when crossing languages (C & C++).
    I refuse to tie my hands behind my back and hear somebody say "Bend Over, Boy, Because You Have It Coming To You".
    -- Linus Torvalds

  13. #13
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    Originally posted by [praetorian]
    kedaman,

    by using structures in an early stage of learning c++ & OOP, do you easier understand classes later?

    Isn't structures quite like classes in some ways?
    I don't know........

    thanks
    No, I think you should go straight on with OOP instead of getting used to functional programming which leaves you with polluted paradigms, a sign that you have missunderstood the use of C++ is that you have global variables and functions around and poorly encapsulated classes, and hardly any abstraction.
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

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