Error: a nonstatic member reference must be relative to a specific object

Discussion in 'C Programming' started by Computerjunkie, Apr 6, 2012.

  1. Computerjunkie

    Computerjunkie

    Joined:
    Apr 6, 2012
    Messages:
    1
    I'm getting this error on this line:
    critter.Play();

    In the Critter.h file the Play() function is as such:
    int critter:: Play()
    {
    system("cls");
    cout << "You play with your critter making it happier!" << endl;
    }


    And i declare Play() in the public: like this:
    int Play();

    How would i get rid of this error? Thanks.
    Computerjunkie, Apr 6, 2012
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pedro López
    Replies:
    0
    Views:
    418
    Pedro López
    Oct 13, 2003
  2. Clay_Culver@yahoo.com
    Replies:
    3
    Views:
    515
    Clay_Culver@yahoo.com
    Nov 4, 2005
  3. The|Godfather
    Replies:
    7
    Views:
    3,927
    Miles Bader
    Oct 24, 2006
  4. fl
    Replies:
    12
    Views:
    810
    Salt_Peter
    Dec 31, 2007
  5. Jeffrey
    Replies:
    7
    Views:
    405
    James Kanze
    Sep 30, 2008
Loading...

Share This Page