In this code:
this->_label = CCLabelTTF::labelWithString(number,"Artial", 32);
number is 5, but must be a const char *.
How can I convert number from an int to the required const char *?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
The only three-argument call listed here is:
That means
numbershould not be anintbut should indeed be aconst char *.If you want to populate it with the string
"5"instead of the integer5, you’ll need to convert it to a string first.Depending on the language you’re using, this could be something like:
(for C) or using something like stringstreams in C++.