2021-11-05

The difference between cstdlib and stdlib.h

The header of the general-purpose standard library for C++, also known as cstdlib in C++, defines a core set of functions used for data type conversion, pseudo-random number generation, memory allocation, searching, sorting, mathematics, and dealing with wide or multibyte characters. It also contains a variety of useful macros in the form of constant values. In many cases C++ programmers use types, functions or constants, that come from cstdlib, without having to include this header, as it is being included by other headers that they are using. Not being aware where some types and utilities come from may later lead to annoying compilation errors, when some previously included header is removed and some constatnt is surprisingly not recognized. Knowing that cstlib might be required can save some time in such cases.

上一篇:优秀程序员是如何突破瓶颈的?


下一篇:1064 Complete Binary Search Tree