Howdy, Stranger!

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

Categories

Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

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.