Home > C++ > FAQ C++ > FAQ C++ - gcc/g++ > Code that compiles with gcc but not g++

Code that compiles with gcc but not g++

Sunday 12 June 2011, by Nadir SOUALEM

#include <stdlib.h>

int main()
{
   char* s = malloc(128);
   return 0;
}

This will compile with gcc, but not with g++. C++ requires an explicit cast from void*

Any message or comments?

Forum registration required

You must be registered before participating in this forum. Please enter your personal identifier . If you have not yet registered, you must register.

Connectionregisterpassword forgotten?