what are default integer values?

后端 未结 3 858
情话喂你
情话喂你 2021-01-14 10:43

I read somewhere that default floating point values like 1.2 are double not float.
So what are default integer values like 6

3条回答
  •  难免孤独
    2021-01-14 11:19

    The type of integer literals given in base 10 is the first type in the following list in which their value can fit:

    • int
    • long int
    • long long int

    For octal and hexadecimal literals, unsigned types will be considered as well, in the following order:

    • int
    • unsigned int
    • long int
    • unsigned long int
    • long long int
    • unsigned long long int

    You can specify a u suffix to force unsigned types, an l suffix to force long or long long, or an ll suffix to force long long.

    Reference: C99, 6.4.4.1p5

提交回复
热议问题