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
- Type casting with malloc() holotko
- Re: Type casting with malloc() Adam Wiggins
- Re: Type casting with malloc() Kurt Wall
- Re: Type casting with malloc() Jason Riedy
- Re: Type casting with malloc() Kurt Wall
- Re: Type casting with malloc() Amol Mohite
- Re: Type casting with malloc() Andre Majorel
