#include <iostream>
using namespace std;
class Assn2
{
public:
static void set_numberofshape();
static void increase_numberofshape();
private:
static int numberofshape22;
};
void Assn2::increase_numberofshape()
{
numberofshape22++;
}
void Assn2::set_numberofshape()
{
numberofshape22=0;
} // there is a problem with my static function declaration
int main()
{
Assn2::set_numberofshape();
}
Why do I get an error undefined reference to Assn2::numberofshape22 when I compile this?
I am trying to declare an static integer :numberofshape22 and two methods.
Method 1 increase numberofshapes22 by 1
Method 2 initialise numberofshape22 to 0
What am I doing wrong ??