Just in case someone tries to compile this in a non-Windows environment: system("Pause") only works on Windows.