I am trying to execute concat "(" + mouseX + "," + mouseY ")". However, mouseX and mouseY are ints, so I tried using a string stream as follows:
std::stringstream pos; pos << "(" << mouseX << ", " << mouseY << ")"; _glutBitmapString(GLUT_BITMAP_HELVETICA_12, pos.str());
And it does not work.
I get the following error:
mouse.cpp: 75: error: cannot convert std::basic_string<char, std::char_traits<char>, std::allocator<char> >' to const char *' for argument 2' to void _glutBitmapString (void *, const char *) '
What am I doing wrong in this base chain + integer concatenation?
source share