#include <stdio.h>
struct context;
struct funcptrs{
void (*func0)(context *ctx);
void (*func1)(void);
};
struct context{
funcptrs fps;
};
void func1 (void) { printf("1\n"); }
void func0 (context *ctx) { printf("0\n"); }
void getContext(context *con){
con=?; // please fill this with a dummy example so that I can get this working. Thanks.
}
int main(int argc, char *argv[]){
funcptrs funcs = { func0, func1 };
context *c;
getContext(c);
c->fps.func0(c);
getchar();
return 0;
}
मुझे यहां कुछ याद आ रहा है। कृपया इसे ठीक करने में मेरी सहायता करें। धन्यवाद।सी में एक संरचना की आगे की घोषणा?
सी आप सिर्फ इतना कहना 'संदर्भ नहीं करता है * जो कुछ भी ; ', है ना? मैंने सोचा कि यह आपको 'संरचना संदर्भ * जो कुछ भी कहता है;' ... – cHao