Question about Classes

This is a discussion on Question about Classes within the C++ Programming forums, part of the General Programming Boards category; hello there, take this code for example (taken from the teachyourself in 21days tut) Code: class Cat { public: unsigned ...

  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 04:18 AM.

  2. #2
    C++ Witch laserlight's Avatar
    Join Date
    Oct 2003
    Location
    Singapore
    Posts
    22,269
    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
    C + C++ Compiler: MinGW port of GCC
    Version Control System: Bazaar

    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
    4,409
    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, 03:46 AM
  2. A little question about classes
    By Newbeee in forum C++ Programming
    Replies: 9
    Last Post: 06-15-2006, 04:46 PM
  3. question on classes
    By ssjnamek in forum C++ Programming
    Replies: 3
    Last Post: 05-09-2005, 05:12 PM
  4. Another question on classes
    By hpy_gilmore8 in forum C++ Programming
    Replies: 26
    Last Post: 05-24-2003, 10:11 AM
  5. classes question
    By ygfperson in forum A Brief History of Cprogramming.com
    Replies: 3
    Last Post: 05-12-2003, 09:56 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21