Math-Linux.com

Knowledge base dedicated to Linux and applied mathematics.

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

Code that compiles with gcc but not g++

#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?

comments powered by Disqus