Convert testpt.c to C++