Take this code for example
The compiler complains that it doesn't know the identifier 'buffer'. Yet, the function that calls 'buffer' is not even called. Why would it complain if it doesn't need to use it yet? Buffer is declared by the time any object is constructed...
#define upleft buffer[a-1][b-1]
#define upcent buffer[a-1][b]
#define upright buffer[a-1][b+1]
#define left buffer[a][b-1]
#define right buffer[a][b+1]
#define loleft buffer[a+1][b-1]
#define locent buffer[a+1][b]
#define loright buffer[a+1][b+1]
I suppose the answer to my question is that yes, the class checks to see if it knows variables before any object is even constructed. But could anyone reassure me on that fact? Why is it implemented this way, making the code above have errors?
Thanks a lot for the help