One of the most annoying things about C++ is the incompatibility with C's void *
conversion. In C, void *
can be cast implicitly to any pointer type, but C++ needs an explicit cast.
Most C code is valid C++ code, but the most common issue is malloc
, which returns void *
.
For example, this is valid C code, but not valid C++ code:
struct Foo *x = malloc(sizeof(struct Foo));