What's the main difference between stdlib.h and cstdlib in C++? -


I am using the EXIT_FAILURE macro, so I have to include stdlib.h or cstdlib. But I do not know what is the difference

P> like EXIT_FAILURE is a macro, There is no difference in which you are involved. The cstdlib version will put names of all the jobs in the std namespace, so that you can say things like:

  std :: Exit (0);  

But macros do not respect the namespace, you can not say:

  std :: EXIT_FAILURE  
< / Div>

Comments