“Uint32”, “int16” and the like; are they standard c++?

前端 未结 6 824
悲&欢浪女
悲&欢浪女 2021-01-03 19:14

I\'m quite new to c++, but I\'ve got the hang of the fundamentals. I\'ve come across the use of \"Uint32\" (in various capitalizations) and similar data types when reading o

6条回答
  •  旧时难觅i
    2021-01-03 19:39

    Unix platforms define these types in stdint.h, this is the preferred method of ensuring type sizing when writing portable code.

    Microsoft's platforms do not define this header, which is a problem when going cross-platform. If you're not using Boost Integer Library already, I recommend getting Paul Hsieh's portable stdint.h implementation of this header for use on Microsoft platforms.

    Update: Visual Studio 2010 and later do define this header.

提交回复
热议问题