taking C code and translating it into C++ code