function
Title
Question
Can I use malloc() function of C language to allocate dynamic memory in C++?
Advanced-Cpp Function-Overloading-And-Overriding 02-03 min 0-10 sec
Answers:
More about malloc() function is available in this webpage.
https://www.geeksforgeeks.org/dynamic-memory-allocation-in-c-using-malloc-calloc-free-and-realloc/
of course yes, the malloc function in c++ allocates a block of uninitialized memory and returns a void pointer to the first byte of the allocated memory block if the allocation succeeds.
If the size is zero, the value returned depends on the implementation of the library.
https://www.programiz.com/cpp-programming/library-function/cstdlib/malloc/
Login to add comment