Convert parserfp.c to C++