C++ code compatible with C