C++ maximum non negative int

前端 未结 5 1562
既然无缘
既然无缘 2021-01-28 12:24

Is the following going to work as expected on all platforms, sizes of int, etc? Or is there a more accepted way of doing it? (I made the following up.)

#define M         


        
5条回答
  •  梦谈多话
    2021-01-28 12:56

    You can have a look at the class numeric_limits, included in the standard library.

    See here.

提交回复
热议问题