Convert jb.c to C++