Converting C ANSI code for a chess interface into C++