On Fri, Apr 07, 2006 at 08:42:45PM -0500, Bo Peng wrote:
> >   commandLine = malloc (commandLineLength);
> 
>  commandLine = (char*)malloc (commandLineLength);
> 
> Usually (to be safe, and is the case for any other type),
> 
>  commandLine = (char*)malloc (commandLineLength*sizeof(char));

There is no need for the cast in C (as the conversion is automatic), and
there is no need for malloc in C++ (as there's 'new' etc).

So the cast is not needed at all.

The solution for Uwe would be to compile his C source with a C compiler
('gcc') instead with the C++ compiler.

Andre'

Reply via email to