This, unfortunately, is defined in some external library: cannot touch!
typedef struct {
long foo;
char *bar;
} *pointer_to_complex_struct_t;
Now Question : how to declare a variable ? complex_struct_t
Ideal solution, but not allowed! (cannot change external library):
} complex_struct_t, *pointer_to_complex_struct_t;
extern complex_struct_t my_variable;
Intolerable Solution (gcc):
extern typeof( * (type_placeholder)0 ) my_variable;
Other? It's better? Thank!
Bonus question: The same question for a function pointer (if there is any difference, I doubt it).
ADDED bonus: - , . ( "" ), , . , , , ( ). , ? copy-paste. , , .
typedef double (*ptr_to_callback_t)(long, int, char *);
typedef typeof( * (ptr_to_callback_t)0 ) callback_t;
extern callback_t callback_1;
extern callback_t callback_2;
extern callback_t callback_3;
= , typeof
- , . , : , .