M
Manuel
Hi!
Anyone can explain me why this work:
--------------------------
class Rect
{
public:
Rect()
{num ++;}
~Rect()
{num --;}
static void pippo(){num ++;};
protected:
static int num;
};
int num = 0;
main(){}
-------------------------
and this not work?
-------------------------
class Rect
{
public:
Rect()
{num ++;}
~Rect()
{num --;}
static void pippo();
protected:
static int num;
};
int num = 0;
void Rect:ippo() {num ++;}
main(){}
Anyone can explain me why this work:
--------------------------
class Rect
{
public:
Rect()
{num ++;}
~Rect()
{num --;}
static void pippo(){num ++;};
protected:
static int num;
};
int num = 0;
main(){}
-------------------------
and this not work?
-------------------------
class Rect
{
public:
Rect()
{num ++;}
~Rect()
{num --;}
static void pippo();
protected:
static int num;
};
int num = 0;
void Rect:ippo() {num ++;}
main(){}