Hallo,
Das Problem, was ich habe ist, dass zwei Strukturen jeweils Zeiger auf
die jeweils andere Struktur haben:
1 | struct tStruct1
|
2 | {
|
3 | struct tStruct2* pStruct2;
|
4 | };
|
5 |
|
6 | struct tStruct2
|
7 | {
|
8 | struct tStruct1* pStruct1;
|
9 | };
|
Alles kein Problem, WENN man vor die Deklaration von tStruct1 folgendes
voranstellt:
Mein Problem ist aber, dass ich anynome Structs im Zusammenhang mit
Typedefs benutze (Ist hiervon eigentlich abzuraten aus irgendwelchen
Gründen?)
1 | typedef struct
|
2 | {
|
3 | tStruct2* pStruct2;
|
4 | }tStruct1;
|
5 |
|
6 | typedef struct
|
7 | {
|
8 | tStruct1* pStruct1;
|
9 | }tStruct2;
|
Was stelle ich jetzt voran?
1 | typedef struct tStruct2;
|
funktioniert jedenfalls nicht:
warning: useless storage class specifier in empty declaration
auch nicht. Redefinition wg. Default int.