Is u_char a standard?

后端 未结 3 522
执笔经年
执笔经年 2021-01-03 20:52

Just curious if u_char is a standard. I\'ve always used it assuming it was defined along with uintX_t types and so on. But am seeing some of our code base transition from

3条回答
  •  天涯浪人
    2021-01-03 21:55

    No, u_char is non-standard. If you need to use a standard type that's equivalent to u_char, you can use uint8_t which is part of the C99 standard library (check your specific platforms/compilers for C99-compliance). stdint.h defines this type (along with many other specific integral types). This Wikipedia article contains more information about stdint.h.

提交回复
热议问题