Switched to C++

Changed strings and added casts to pointers and casted signed int to
unsigned to avoid warnings.