And holotko writes:
 -   objectpointer = (ObjectType *)malloc(sizeof(ObjectType));
 - 
 - My question. Do I really need to add the type cast (ObjectType *)
 - before the call to malloc() ?

ISO C++ requires the cast.  See 4.10 (p60) and C.1.2.6 (p689) of
the standard.  If someone wants to compile this in C++ (for some
unknown reason), the compiler should refuse to accept it without
the cast.  For justification, consider what would happen in
overloading and template parameter matching.

Jason

Reply via email to