• ### Announcements

#### Archived

This topic is now archived and is closed to further replies.

# Will class member data automatically update...

## Recommended Posts

...if I were to do something like this?
class Foo
{

int x = 1;
int y = 1;
int z = x * y;

public:

Set_XY(int x, int y);

};

If I used Set_XY to change the values of x and y, will z automatically update? This is one of those threads where half-way through typing it I realized two things: a) This is a stupid question. b) I can easily figure it out myself by programming a test. And yet here I will press the post button anyway to as to preserve this dingleberry of wisdom on GameDev''s immortal server.

##### Share on other sites
The question is meaningless. The syntax you used will fail to compile.

##### Share on other sites
afaik variables can only be declared with constants