I was under the impression that alloc
in Objective-C (when we invoke [anyObject alloc]
is actually implementing C function malloc
and the
I don't remember the verbatim statement from the book C++ Primer, but there is a major difference between the functions. For example new in C++ allocates memory, but it also constructs the data into the memory. The std::allocator allocates memory, but doesn't call any constructor. The same is true for these C functions. One allocates but doesn't construct. One allocates and construct.