object variable value problem

i have this code in .cpp 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
29
30
31
32
33
34
35
36
37
38
39
class FrameData {
public:
	int x, y, w, cw;
	Uint32 cl;
	FrameData(int _x, int _y, int _w, int _cw, Uint32 _cl);
} duom(50, 25, 23, 10, 0x258A1C);

class Dalis {
public:
	int x, y;
	short k;
	bool forma[4][4];
	Dalis();
	void generate();
	void rotate();
};

class Grid {
public:
	bool grid[12][19];
	Dalis dg;
	Grid();
	void clear();
	void delrow(int n);
	bool move_piece(int c);
	void render();
	bool merge();
} field;

class Button {
private:
    SDL_Rect box;
    SDL_Rect* clip;
	SDL_Surface *txt;
public:
    Button(int x, int y, int w, int h);
    bool handle_events();
    void show();
} pradeti(SCREEN_WIDTH/2-85, 230, 170, 40), baigti(SCREEN_WIDTH/2-85, 280, 170, 40);

Problem is that duom object values x and cl becomes 0 at the point of field creation. Why is this happening and how to fix it? Thanks.
I've put the class definitions and implementations in separate files and in main.cpp I first instantiated Grid object, then Button objects and after that FrameData object and now it works well. But i'd still appreciate if someone could explain why the data changes that way.
Topic archived. No new replies allowed.