Answer the question
In order to leave comments, you need to log in
Is it possible to use variables in the system function?
For example, there is a code:
int main(void)
{
int i = 1;
system("echo $i")
return 0;
}
Answer the question
In order to leave comments, you need to log in
Sit down and learn C++, this is not PHP for you.
Use std::to_string(i) and concatenate the string you need, or do a replacement on the original string with std::string's replace method.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question