Fixed: Now uses C++ iostreams instead of stdio.