c - C4047 - Levels of Indirection - Struct initialization -
i working old software of company , try figure out how make stuff works properly.
after database editing, got software gives me *.c files compile later environment simultation tool.
my main problem did not manage compilation working. facing 2 mains errors :
error : c2097 : illegal initialization
and
warning c4047 'initializing' : different levels of indirection.
i started research understand levels of indirection. think understand thing trying save pointer of pointer pointer of data etc.
the code not mine. of in computer generated application. point people developped stuff retired.
here main parts of code:
st_fami.h
struct bit { unsigned bit0 :1; unsigned bit1 :1; unsigned bit2 :1; unsigned bit3 :1; unsigned bit4 :1; unsigned bit5 :1; unsigned bit6 :1; unsigned bit7 :1; unsigned bitnul :8; }; union etatbit { int vetat ; struct bit vbit; }; typedef struct { union etatbit vactuel; union etatbit vanteri; int visuelem; int tmpcartc; } elemoct; struct fami { char *plibfami; int pnbelem ; char ptypfami[2]; int pmsgrancom[2]; char pnbliuti; char vetavisfami; char vnumliu; char vpagfami; unsigned char pnumpsbac; unsigned int pnumgrpa[5]; char pnumvoie; elemoct *tptelmsg; };
my m1l0ps1.c file :
line 1: #include "st_fami" line 2: line 3: elemoct e_l0ps1pq0[64]; line 4: struct fami l0ps1pq0 = line 5: {"l0ps1pq0", line 6: 64, line 7: {'m','p'}, line 8: {'t',0 }, line 9: 17, line 10: 0, line 11: 0, line 12: 0, line 13: 1, line 14: 0, line 15: 0, line 16: e_l0ps1pq0};
error log :
m1l0ps1.c m1l0ps1.c(16) : error c2097: illegal initialization m1l0ps1.c(16) : warning c4047: 'initializing' : different levels of indirection
my question : dont levels of indirection error. tried de give initialization differents data : &(e_l0ps1pq1[0]) (adress of element 0) ait doesnt work intended.
what wrong code? note proper c developper. used c++ or java , knowledge of pointers bit biased because of less strict languages. compiling "microsoft (r) c optimizing copiler version 5.10".
sorry english , if read through whole text ! :d
pnumgrpa[5]
array. attempt initialize 0
rather {0}
.
Comments
Post a Comment