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

后端 未结 10 1423
傲寒
傲寒 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 09:53

    I think the correct answer should be 2. By definition, char is the smallest addressable unit.

    Also see: Why is a char and a bool the same size in c++?

提交回复
热议问题