Use C++ casts instead of C casts. One needs reinterpet_cast to be able to convert from char* to int*.