I want to define a pointer to an character array of a set value in a header file.
Essentially - I want to declare a chessboard in a header file.
Would something like this work, or should I be using #define?
Thank you.
#ifndef myHeader
#define myHeader
typedef *char[8][8] Chessboard;
#endif
EDIT:
I have to admit I'm practicing for an upcoming test and this is just an old assignment (from one of the previous tests).
After some thought and study on how header files behave, I've found that
char array[8][8];
char*** Chessboard = (char***) malloc (sizeof (char**));
*(Chessboard) = array;
could work - however, I'm supposed to declare a type, and don't know how to do this.
To clarify - I want to define a type "Chessboard", that is a pointer to an 8x8 array.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…