+ 5

What is the difference between "cmath.h" and "math.h" or "cstdlib.h" and "stdlib.h" ?

23rd Apr 2018, 2:07 PM
Naman
Naman - avatar
3 Answers
+ 24
đŸ€”đŸ€”đŸ€”u mean difference between math.h and cmath ... because there is no such thing as cmath.h math.h is a C library header. Its use is deprecated, but works in C++. cmath is a C++ library header. It has the stuff from math.h in the correct namespace plus a lot more.... basically in C++ the C library header files that have .h as postfix are removed and c is added in the prefix.... so math.h in C became cmath in C++ having few more functions... stdlib.h in C is similarly same cstdlib in C++ check out this link for more. 👇 https://www.quora.com/What-is-the-difference-between-math-h-and-cmath-What-is-the-difference-between-iostream-and-iostream-h-in-C++
23rd Apr 2018, 4:07 PM
🌛DT🌜
🌛DT🌜 - avatar
+ 4
23rd Apr 2018, 5:50 PM
Naman
Naman - avatar