![]() |
| ||
| External Delaration for An Array? Hi, I have an array. I put its definition in a .c file and externally delare it in a .h file like this: //.c file unsigned char jetmap[][]={ {0, 207, 255}, {0, 223, 255}, {0, 239, 255}, {0, 255, 255}, {16, 255, 239}, {32, 255, 223}, {48, 255, 207}, {64, 255, 191}, {80, 255, 175} } ... //.h file extern unsigned char jetmap[][]; //missing subscript // extern unsigned char ** jetmap; // redefinition; different types of indirection As in the comment of the header file, both declarations are reported wrong by complier. How to delare the correct type of an array? Thanks in advance! |
| ||
| Re: External Delaration for An Array? >extern unsigned char jetmap[][]; //missing subscript Yep, you're required to specify all but the first dimension, even for an incomplete type. You need it in the definition too: /* .c file */>extern unsigned char ** jetmap; // redefinition; different types of indirection Yep, the declaration doesn't match the definition. The type of jetmap in the definition is unsigned char (*)[3]. |
| ||
| Re: External Delaration for An Array? Thank you! |
| All times are GMT -4. The time now is 7:58 am. |
Forum system based on vBulletin Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
©2003 - 2009 DaniWeb® LLC