Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7218863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T21:32:27+00:00 2026-05-28T21:32:27+00:00

Okay so my question is this. Say I have a simple C++ code: #include

  • 0

Okay so my question is this. Say I have a simple C++ code:

#include <iostream>
using namespace std;

int main(){
   cout << "Hello World" << endl;
   return 0;
}

Now say I have this program that I would like to run in my program, call it prog. Running this in the terminal could be done by:

./prog

Is there a way to just do this from my simple C++ program? For instance

#include <iostream>
using namespace std;

int main(){
   ./prog ??
   cout << "Hello World" << endl;
   return 0;
}

Any feedback would be very much obliged.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T21:32:27+00:00Added an answer on May 28, 2026 at 9:32 pm

    You want the system() library call; see system(3). For example:

    #include <cstdlib>
    
    int main() {
       std::system("./prog");
       return 0;
    }
    

    The exact command string will be system-dependent, of course.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Okay this may be a simple question but I have yet to come with
Okay this is a homework question, and I just don't have a clue how
Just a simple question, say I have a table and one of their attributes
Okay, i have this question in one regarding threads. there are two unsynchronized threads
okay, this might be a silly question. So I have some tuples of size
Okay, I know this question has been asked before: Previous Question I have also
Okay guess this question looks a lot like: What is the best way to
Okay, this question comes through a friend so it might be lost in translation...
Okay this is not a question of how to get all uniques or How
okay so this is probably a soft pitch question for sombody, but I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.