Thread: question about classes

  1. #1
    Registered User
    Join Date
    Mar 2002
    Posts
    12

    question about classes

    just to make sure... i can return a class from a function correct??? ie. if i had a class: car, i could have a function manipulate a certain car and return it.:



    class car
    {
    blah();
    whatever();
    };

    car function();

    void main(void)
    {
    car Ford;

    Ford = function();
    }


    car function();
    {
    car buick;
    codeTo();
    defineBuick();
    return Buick;
    }


    should work right...

  2. #2
    Registered User
    Join Date
    Mar 2002
    Posts
    1,595
    yea...

  3. #3
    Registered User
    Join Date
    Mar 2002
    Posts
    12
    thx..... must just be a problem elsewhere in my program

  4. #4
    Registered User biosx's Avatar
    Join Date
    Aug 2001
    Posts
    230
    Not to be a jerk , but you don't return a class but you return an object. I'm sorry, it's like midnight here and I need something to do.

  5. #5
    Registered User
    Join Date
    Mar 2002
    Posts
    12
    i apoligize for my inexperience with the terminology. Thank you for correcting me.

  6. #6
    Registered User biosx's Avatar
    Join Date
    Aug 2001
    Posts
    230
    Originally posted by Kespire
    i apoligize for my inexperience with the terminology. Thank you for correcting me.
    I've been there, man. We all have.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Classes question...
    By Raigne in forum C++ Programming
    Replies: 24
    Last Post: 09-12-2006, 01:46 AM
  2. Replies: 2
    Last Post: 07-28-2006, 02:59 PM
  3. Simple Question about Classes
    By Loctan in forum C++ Programming
    Replies: 5
    Last Post: 06-26-2006, 02:40 AM
  4. Classes and Win32 API, and another Question
    By philvaira in forum Windows Programming
    Replies: 10
    Last Post: 04-10-2004, 07:21 PM
  5. Newbie question about the Private type in classes
    By Ryeguy457 in forum C++ Programming
    Replies: 1
    Last Post: 09-07-2002, 10:17 PM