Be aware that if you are sending a binary with this code to a non-Windows platform, even if you cross-compile it, it won't run.
System("pause") is not considered a good way to stop the consol, since it's platform specific. Use cin.get() instead to eliminate this problem.
Not sure this is relevant to your test situation now, but still might be usefull to know.