What's the difference between cstdlib and stdl

2019-01-16 11:07发布

问题:

When writing C++ code is there any difference between:

#include <cstdlib>

and

#include <stdlib.h>

other than the former being mostly contained within the std:: namespace?

Is there any reason other than coding standards and style to use one over the other?

回答1:

The first one is a C++ header and the second is a C header. Since the first uses a namespace, that would seem to be preferable.



回答2:

No, other than the namespace situation, they're essentially identical.



标签: c++ std