mercredi 1 août 2018

How to get input in new terminal c++

My goal is to get the users input and use that when I open an new program, for example;

cout << "Choose a city\n1. New York\n2. Hong Kong"

cout << "choice: "
cin >> city;

std::system("./program (and here the user input)");

But how do I get the input when I want to use it in a new program?

I use g++ compiler C++11 in Linux

Aucun commentaire:

Enregistrer un commentaire