First, you have to think about what the system() function really does: it executes not just ... at the command prompt before running the program.
www.cplusplus.com