Convert loadfdos.c to C++