Translation from C to C++