invalid conversion from `void*’ to `char*’ when using malloc? February 23, 2023 by Tarik In C++, you need to cast the return of malloc() char *foo = (char*)malloc(1);