This question already has an answer here:
What are the considerations for including the former rather than the latter in a C++ program? I always include math.h
, stdlib.h
and never cmath
, cstdlib
etc. I don't understand the reason the latter even exist, could someone please enlighten me?
Prefer to include the
<c ...>
headers. They are C++ standard library headers. The<... .h>
headers are headers defined by the C standard library:The C++ headers, for the most part, have content identical to the corresponding C library headers except that the names are all defined in the
std
namespace.