C结构内的typedef [英] Typedef inside a C struct
本文介绍了C结构内的typedef的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
第一关code这博格尔斯我的脑海:
First off the code which boggles my mind:
typedef struct Object {
typedef int MojInt;
void (*destructor)(Object *);
void *(*constructor)(struct Object *);
} Object;
为什么编译器prevent我从定义结构内的typedef?
Why does compiler prevent me from defining a typedef inside a struct?
推荐答案
这只是不允许的。类似的是允许在 C ++ 的类,但不是在标准C
It's just not allowed. Something similar is allowed in C++ classes, but not in standard C.
这篇关于C结构内的typedef的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文