This is good work to convert from C to C++. C++ is often considered to be a superset of C. Most C code can easily be made to compile correctly in C++.