Of int, char, float, and bool, which is smallest?

后端 未结 10 1296
傲寒
傲寒 2021-02-02 09:51

The following is from a \"fill-in at home\" programming test that is part of the application process for an MSc in game development at a UK university:

C+

10条回答
  •  北恋
    北恋 (楼主)
    2021-02-02 10:00

    The C++ standard gives following relations:

    sizeof(char) == 1
    sizeof(char) <= sizeof(int) <= sizeof(long)
    sizeof(float) <= sizeof(double)
    

    ...

提交回复
热议问题