My biggest question > program opening another - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

My biggest question > program opening another

Allegro_DevAllegro_Dev Posts: 23Member
This has always bugged me..
and now i guess is as good a time as any to ask

how would one RUN another *.exe from c++

example:

[code]
cout << "press (1) for Notepad press (2) for paint : ";
cin >> input; cin.ignore(); // <-- ty stober

if(input == 1){
/* INSERT CODE HERE */

}else if(input ==2){
/* INSERT CODE HERE */

}
[/code]

is this clear enough??

Comments

  • stoberstober Posts: 9,765Member ✭✭✭
    : This has always bugged me..
    : and now i guess is as good a time as any to ask
    :
    : how would one RUN another *.exe from c++
    :
    : example:


    there are several ways to execute an external program, depending on the operating system. The most generic and portable way is to call the system() function, but you have the least amount of control over how it is launched.
    [code]
    system("someProgram.exe arg1 arg2");
    [/code]
Sign In or Register to comment.