March 2019
Intermediate to advanced
708 pages
17h 9m
English
In C++, use of malloc() was replaced as a best practice by use of the new operator. The main difference between the functionality of malloc() and the new operator is that new will call the constructor on object types after memory allocation. Refer to the following table:
|
malloc |
Allocates a zone of contiguous space for use |
|
new |
Allocates a zone of contiguous space for use Calls constructor as an object type used as an argument to the new operator. |
Read now
Unlock full access