I am wondering how I can pass a variable to the system function. i.e.:
int x=3;
char y='B';
system("color" x y);
Obviously the code doesn't work like that, but you get the point.
system function's signature is int system(const char* command);. So in short, it does not take second argument.
how about:
string a;
system(a.c_str());
If its possible to make x and y strings...
|
system(("color "+x+y).c_str());
|
Last edited on