Right off the bat, no this is not a duplicate. I have been searching for hours to do this but it might be simple as I started coding a few weeks ago.
How do I concatenate a string with a float inside the arguments?
I want to be able to do this, but it is not working:
system("xdotool mousemove " << $2 << " " << $3);
Yes, this is C++, just that I am using this inside of Bison, so the $2 and $3 are variables (which are floats). As in the Bison file I have a lot of things going on, I would appreciate having a solution in one line, like the format I have going on here.
EDIT
The problem here is actually with the concatenation. I did this, but it still doesn't work, and gave me the same error:
string temp = "xdotool mousemove " << $3 << " " << $4; system(temp.c_str());
EDIT 2
Sorry for so many edits, but I tried doing
system(("xdotool mousemove " + to_string($3) + " " + to_string($4)).c_str());
but it still doesn't work :( Any other ideas? This time the error says ‘to_string’ was not declared in this scope
Kind Regards,
Matthew Sanetra