How would I make a C++ program run another exe file? Like make my program to where if you press 1 it opens another program.
How would I make a C++ program run another exe file? Like make my program to where if you press 1 it opens another program.
Since you didn't specify a compiler or operating system, the only way is to use the standard function system() in cstdlib:
Code:#include <cstdlib> std::system ( "<path to the exe>" );
My best code is written with the delete key.
one way would be using function system:More info:Code:system("path/to/exe");
http://www.cppreference.com/stdother...ls.html#system
EDIT:
you beat me to it Prelude
Last edited by glUser3f; 01-12-2004 at 08:50 AM.
Just remember how unsafe it is before using it!
Do not make direct eye contact with me.
You sure it is std::system()? All thought all functions from C weren't included in the standard library?Originally posted by Prelude
Since you didn't specify a compiler or operating system, the only way is to use the standard function system() in cstdlib:
Code:#include <cstdlib> std::system ( "<path to the exe>" );
trainee
They exist in the global namespace as well as the std namespaceOriginally posted by trainee
You sure it is std::system()? All thought all functions from C weren't included in the standard library?
trainee
Also, isnt the original question in the FAQ?