typedef struct vs. Object - Benefits
2015-05-21 14:09
246 查看
How many items like this you plan to create? - If the answer is "millions",
if the answer is "fifty eight", object wins.
Do you need to define methods on it? - If the answer is "yes", object wins; otherwise,
be OK.
Do you plan to define arrays of it? - If the answer is "yes",
be a better choice.
Do you need to create and destroy it often? - If the answer is "yes",
be a better choice.
structwins;
if the answer is "fifty eight", object wins.
Do you need to define methods on it? - If the answer is "yes", object wins; otherwise,
structmay
be OK.
Do you plan to define arrays of it? - If the answer is "yes",
structmay
be a better choice.
Do you need to create and destroy it often? - If the answer is "yes",
structmay
be a better choice.
相关文章推荐
- VS2015 + QT 编译出现public: virtual struct QMetaObject const * __thiscall 错误
- Object-C学习(五):结构体(struct)、typedef、以及与#define宏定义的区别
- typedef struct _DRIVER_OBJECT
- typedef struct _DEVICE_OBJECT *PDEVICE_OBJECT;
- C++中typedef struct与struct的区别
- typedef struct 用法详解和用法小结 及 在C和C++中的区别
- 结构体(struct) vs 类(class)
- struct和typedef struct彻底明白了
- struct和typedef struct彻底明白了 && C语言结构体
- struct和typedef struct
- Python-struct.error: argument for 's' must be a bytes object
- typedef struct 用法详解
- typedef struct 《转载的》
- 【VS开发】error C2220: 警告被视为错误 - 没有生成“object”文件
- struct和typedef struct
- 【转】struct和typedef struct
- struct和typedef struct
- typedef struct与struct的区别
- struct和typedef struct
- 在C和C++中struct和typedef struct的区别