This is incorrect. malloc() returns a void*, which, if your compiler is typecasting for you, your compiler is broken.
You must typecast the result of malloc() to the type that you require.
[code] char* p = (char*)malloc( 10 * sizeof(char) ); [/quote]
will compile,
[code] char *p = malloc( 10 * sizeof(char) ); [/quote]
will not, not even in vc++.
|