agus
Newbie level 4
how to add member variable to class in vc++
hai..I am beginer in programing. My question is as below;
My question is to declare image[m][m] as a member variable.
I try to add image[m][m] as a member variable in two places,
[1]
// XXXXView.h
// Implementation
public:
image[m][m]
[2]
// XXXXView.h
// XXXXView drawing
image[m][m]
Both places give no error after compile. It is true to declare a member variable as both as above. Can someone give me a simple explanation about a global variable and also a local variable as in my example above. In the implementation of CLASS, where should I put it.
Agus
hai..I am beginer in programing. My question is as below;
Code:
// XXXXXView.cpp
// CXXXXXView drawing
for(i=0;i<400;i++)
{
for(j=0;j<400;j++){
m=0.25*i;
n=0.25*j;
image[m][n]=P;
}
}
My question is to declare image[m][m] as a member variable.
I try to add image[m][m] as a member variable in two places,
[1]
// XXXXView.h
// Implementation
public:
image[m][m]
[2]
// XXXXView.h
// XXXXView drawing
image[m][m]
Both places give no error after compile. It is true to declare a member variable as both as above. Can someone give me a simple explanation about a global variable and also a local variable as in my example above. In the implementation of CLASS, where should I put it.
Agus