0
using stdlib is a good practice in c++?
2 Answers
+ 2
The stdlib is not necessary in C++ in most cases. The STL has a lot of containers like vectors, deque etc. that take care of the memory allocation for you. Even if you used a fixed size container you'd still use vec and reserve the memory when calling the constructor. Additionally C++ has its own free() function called delete() for objects and also RAII which makes even delete() obsolete in most cases.
I can hardly imagine a case where you'd still use malloc, calloc, realloc or free except if you want to optimize your the performance of your code to the maximum. But if you need them don't be shy and use them. Just don't forget that pointers are dangerous :)
+ 3
Depends on the application.
I do not believe there any faults in using the cstdlib C language library.