L
L
luzhskij2014-11-21 15:37:57
Qt
luzhskij, 2014-11-21 15:37:57

How to make command passing from C++ code to console?

Hello everybody!
It became interesting how the process could be organized.
There is some executable file that performs some functions.
Let's say the user selects some file, selects some options. It then chooses a new filename and destination folder.
Question! How to pass all this data to the console? Those. pass a command like "executable_file_name option1 option2 input_file output_file".
(Development is in C++/Qt under windows)
Thank you for your attention!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Armenian Radio, 2014-11-21
@luzhskij

system("имя_исполняемого_файла опция1 опция2 входной_файл выходной_файл");

#include <sstream>
...
{
   std::stringstream st;
   int i=9000;
   std::string str_param="value";
   st<<"command "<<i<<" " << str_param;
   system(st.str().c_str());
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question