Omitting the datatype (e.g. “unsigned” instead of “unsigned int”)

后端 未结 4 2047
猫巷女王i
猫巷女王i 2021-01-31 08:01

I know that if the data type declaration is omitted in C/C++ code in such way: unsigned test=5;, the compiler automatically makes this variable an int (an unsigned

4条回答
  •  野性不改
    2021-01-31 09:02

    I would even take it one step further and use stdint's uint32_t type.
    It might be a matter of taste, but I prefer to know what primitive I'm using over some ancient consideration of optimising per platform.

提交回复
热议问题