Original Post
I have a Class1 with a variable called Test which is initialized at 0. In another class (Class2) a pointer is used to retreive the Test value. The problem is it will always get the value 0 even after Class1 changes the variable to 1.
My pointer looks like this.
Class1 *pointer = new Class1;
if (pointer->Test == 0)
{
MessageBox("0");
}
else if (pointer->Test == 1)
{
MessageBox("1");
}
delete pointer;
I''m sorry for putting this up because there are articles on pointers all over but I jus can''t figure it out.
I also tried:
Class1 pointer;
if (pointer.Test == 0)
{
MessageBox("0");
}
else if (pointer.Test == 1)
{
MessageBox("1");
}