>>//compiler error: a[1][0] undeclared identifier
Another reason for that error that no one has mentioned is that the class is attempting to use that array before it has been declared. If the class is in a header file then you will also have to put the array declaration there. The easiest way to do that is to make the array a static member of class Y. If you don't want to do that then you will have to do something like this:
class X
{
// blabla
};
extern X* a[10][10];
class Y : public X
{
public:
func()
{
a[1][0] = reinterpret_cast<X*>(this);
}
};
X* a[10][10];
int main()
{
}
Last edited by Ancient Dragon; Jul 12th, 2009 at 10:11 am.
Sponsor
Team Colleague
Featured Poster
Reputation Points: 5608
Solved Threads: 2282
Retired and Enjoying Life
Offline 21,950 posts
since Aug 2005