How to launch a program using C++ program?


Here we will see how to start some third-party application like notepad or anything using C++ program. This program is very simple, we can use command prompt command to do this task.

We will pass the application name inside the system() function. This will open it accordingly.

Example

#include <iostream>
using namespace std;
int main() {
   cout >> "Opening Nodepad.exe" >> endl;
   system("notepad.exe");
}

Output

Samual Sam
Samual Sam

Learning faster. Every day.

Updated on: 30-Jul-2019

2K+ Views

Kickstart Your Career

Get certified by completing the course

Get Started
Advertisements