When do you use malloc in c++?
Course: https://www.educative.io/courses/cpp-basics
Lesson: Educative: Interactive Courses for Software Developers
When do you use malloc in c++?
Course: https://www.educative.io/courses/cpp-basics
Lesson: Educative: Interactive Courses for Software Developers
To allocate the specified number of bytes, the C++ function malloc()
is used. It provides a reference to the first byte of memory that has been allocated. A dynamic memory allocation mechanism, malloc()
allocates memory at runtime. If it fails, it gives back a null pointer.