moved main.c to C++; replaced ftw.h with dig.h for use on Windows