Click to See Complete Forum and Search --> : what is wrong with that?
kingroudy
04-07-2007, 06:05 AM
const int NUM_ROW=15;
const int NUM_COL=15;
typedef int [NUM_ROW][NUM_COL] TwoDimArray;
can someone tell me how to correct that?
I'm so confused that this is giving me errors and warnings, i use visual C++ 6.0.
i looked at my notes it seems that there is something wrong
please help:)
Strogian
04-07-2007, 09:40 AM
You may have to change your file extension from .c to .cpp. If that doesn't work, change 'const int NUM_ROW=15;' to '#define NUM_ROW 15'. I know C++ doesn't like using variables in array declarations, and I'm not sure if they ever made 'const' act like an actual constant, rather than just a variable that you can't change.
kingroudy
04-07-2007, 04:18 PM
Not working Strogian, can someone please write me how to create a new type TwoDimArray of size NUM_ROW NUM_COL using typedef?
crap i have a project!
Strogian
04-07-2007, 04:46 PM
Oh whoops, didn't realize it was a typedef. You need to put the indexers after the identifier. Basically, the rule is, take away the word 'typedef', and you should have a valid declaration:
typedef int TwoDimArray[NUM_ROW][NUM_COL];
int xyzArray[NUM_ROW][NUM_COL];