Thread: Question about Classes

  1. #1
    Registered User
    Join Date
    May 2012
    Posts
    14

    Question about Classes

    hello there,

    take this code for example (taken from the teachyourself in 21days tut)

    Code:
    class Cat {
    public:
    unsigned int Age;
    unsigned int Weight;
    void Meow();
    };
    don't i have to define the function Meow() somewhere? where do i do this?
    i type this class in one of my codes, who knows what does the Meow?


    do you understand what i mean?
    if i declare a regular function in main(), then i have to define that function later on somewhere.
    in this tutorial nothing is mentioned about this when they write about classes.

    ---------
    edit:

    lol, right after i posted this thread i found the answer few pages down in that tut.
    thank you guys anyway .
    Last edited by Jonathan Yaniv; 05-31-2012 at 03:18 AM.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    28,413
    Quote Originally Posted by Jonathan Yaniv
    lol, right after i posted this thread i found the answer few pages down in that tut.
    Good to hear that
    Quote Originally Posted by Bjarne Stroustrup (2000-10-14)
    I get maybe two dozen requests for help with some sort of programming or design problem every day. Most have more sense than to send me hundreds of lines of code. If they do, I ask them to find the smallest example that exhibits the problem and send me that. Mostly, they then find the error themselves. "Finding the smallest program that demonstrates the error" is a powerful debugging tool.
    Look up a C++ Reference and learn How To Ask Questions The Smart Way

  3. #3
    Master Apprentice phantomotap's Avatar
    Join Date
    Jan 2008
    Posts
    5,108
    When this sort of thing happens you should answer your own questions so that other might also learn from the solution.

    Soma

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Question about classes
    By mjhamrick in forum C++ Programming
    Replies: 5
    Last Post: 06-27-2010, 02:46 AM
  2. A little question about classes
    By Newbeee in forum C++ Programming
    Replies: 9
    Last Post: 06-15-2006, 03:46 PM
  3. question on classes
    By ssjnamek in forum C++ Programming
    Replies: 3
    Last Post: 05-09-2005, 04:12 PM
  4. Another question on classes
    By hpy_gilmore8 in forum C++ Programming
    Replies: 26
    Last Post: 05-24-2003, 09:11 AM
  5. classes question
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 05-12-2003, 08:56 PM