Converting integer to string in C++ here is example function that convert integer score into string This function use in Coco2d updating the score in game.
void MyClass:updateScore(int score) { const int labelLength = 100; char scoreLabelText[labelLength]; sprintf(scoreLabelText, labelLength, "Score: %d", score); __pScoreLabel->setString(scoreLabelText); }
0 comments:
Post a Comment