This my code.
struct MemoryStruct {
  char *memory;
  size_t size;
};
 struct MemoryStruct *mem = &state->characters;
  mem->memory = realloc(mem->memory, mem->size + len + 1);
When I run this code in 'C' and compile it by gcc, I didn't get any error.
But same code, I run in C++ and compile it by g++, I am getting error as
error: invalid conversion from ‘void*’ to ‘char*’ [-fpermissive]
Why It did give error in C++ and not giving error in C
 
     
     
     
     
    