Results 1 to 6 of 6

Thread: Please explain the difference between ...

  1. #1

    Thread Starter
    Lively Member fundean's Avatar
    Join Date
    Apr 2001
    Posts
    98

    Please explain the difference between ...

    a Class;
    an Object in that Class;
    a Library

    Please use an example

  2. #2
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    A class is a type of object. "Filly is a turtle"
    A library is a interface (a tool or set of tools) for a programmer. Also known as API - advanced programmers interface.
    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.

  3. #3
    Monday Morning Lunatic parksie's Avatar
    Join Date
    Mar 2000
    Location
    Mashin' on the motorway
    Posts
    8,169
    Originally posted by kedaman
    A class is a type of object. "Filly is a turtle"
    A library is a interface (a tool or set of tools) for a programmer. Also known as API - advanced programmers interface.
    API = Application Programming Interface, and it doesn't necessarily have to be in a library.

    As far as C++ goes:
    Code:
    class Turtle {
    public:
        Turtle(); // Constructor
        ~Turtle(); // Destructor
    
        PublicMethod();
    
    private:
        PrivateMethod();
    
        int m_iPrivData;
    };
    
    Turtle filburt1; // Object of the "Turtle" 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

  4. #4
    Zaei
    Guest
    A class is like a cookie cutter (Oh, no! not the cookie cutter analogy again!). Objects are created from a class, like you create a cookie from a cookie cutter.

    A Library is a collection of Functions, classes, or whatever that you can use. The STL is a good example. It is a library of various templated container classes.

    There is also your Public Library, which is a collection of books =).

    Z.

    [edit]
    Yes, I can type...
    "collection fo Functions"

  5. #5
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    I think my filly is a turtle analogue is better
    ARgh, i always get that wrong, ok Application programming interface - can't miss it next time
    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.

  6. #6
    Kitten CornedBee's Avatar
    Join Date
    Aug 2001
    Location
    In a microchip!
    Posts
    11,594
    Hehe, keda, sometimes it really seems like an "advanced programmers interface"
    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.

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