dos prompt disappearing

This is a discussion on dos prompt disappearing within the C++ Programming forums, part of the General Programming Boards category; I want to make a program similar to the dos prompt (i dont know the english name for it) in ...

dos prompt disappearing

I want to make a program similar to the dos prompt (i dont know the english name for it) in wich you can issue commands to your system (like 'netsat -n' or 'ping 127.0.0.1'). It works, but it should return to the main() function as soon as the command was executed. Instead, it closes. The code i have so far is: