How to properly declare static data members?

I tried to declare a static data member in the header file of my class (Square). I got the following error:

Square.cpp:13: error: expected unqualified-id before ‘int’
Square.cpp: In function ‘int numFilled()’:
Square.cpp:91: error: ‘squaresSolved’ was not declared in this scope

Here is the header file:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#ifndef SQUARE_H
#define SQUARE_H
using namespace std;

class Square
{
public:
	Square();
	~Square();
	
	static int squaresSolved;
	
	void operator = ( const int other );          
	
	void checkSquare(const Square other);
	void checkOnly();
	bool checkPoss();
	int blockRowInit(int);
	int blockColInit(int);
	int numFilled();
private:
	bool m_isSolved;
	int m_Solution;
	int m_Possibilities[9];
	int m_numPossibilities;

	
};


I don't understand where/how to declare and initialize it properly.... I looked in my textbook, and I could not find anything helpful. I also looked on the internet, but I could not find anything I could understand.
In the cpp file

 
int Square::squaresSolved /* = some number, if you want to initialize it here */;


Topic archived. No new replies allowed.