Reputation: 80
Limits is the header file in c++ which consists of numeric_limits
class whereas climits is the header file consisting of the min and max values of various data types only.
Limits can be used whereever one wants to use climits, however the opposite of this is not true.
Hence when is it advised to use climits and when limits?
Upvotes: 5
Views: 4210
Reputation: 1798
climits
/limits.h
is part of the programming language C. If you are writing in C then you use that. C++ has this because it inherits the standard library from C.
limits
serves the same purpose, but via a modernized C++ interface. If you are wrting C++, then always use this. There is no reason to use the C header.
Upvotes: 7