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

前端 未结 6 799
悲&欢浪女
悲&欢浪女 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条回答
  •  执念已碎
    2021-01-03 19:36

    uint32 et al. are defined by macros. They solve a historic portability problem of there being few guarantees across platforms (back when there there more platform options than now) of how many bits you'd get when you asked for an int or a short. (One now-defunct C compile for the Mac provided 8-bit shorts!).

提交回复
热议问题