using fstream instead of FILE, not test