Difference between uint32 and uint32_t [duplicate]

拥有回忆 提交于 2019-12-20 08:23:18

问题


Possible Duplicate:
Difference between different integer types

What is the difference between uint32 and uint32_t in C/C++?

Are they OS dependent?

In which case should I use one or another?

Thanks


回答1:


uint32_t is standard, uint32 is not. That is, if you include <inttypes.h> or <stdint.h>, you will get a definition of uint32_t. uint32 is a typedef in some local code base, but you should not expect it to exist unless you define it yourself. And defining it yourself is a bad idea.




回答2:


uint32_t is defined in the standard, in

18.4.1 Header <cstdint> synopsis [cstdint.syn]

namespace std {
//...
typedef unsigned integer type uint32_t; // optional
//...
}

uint32 is not, it's a shortcut provided by some compilers (probably as typedef uint32_t uint32) for ease of use.



来源:https://stackoverflow.com/questions/13362084/difference-between-uint32-and-uint32-t

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!