Just like fubarpk said. The disadvantage of this strcat is that you always have to make sure that there is enough memory in the target string and that you have to think of the terminating zero.
Another solution would be to work with c++ std::string's.
#include <string>
...
std::string text = "Text ";
std::string num = agk::str(number);
agk:Print((text+num).c_str());
Another solution is to work with formatted strings.
char TextBuffer[256];
sprintf(TextBuffer, "Text: %d (%x)", number, number);
agk:Print(TextBuffer);
Here number is displayed in decimal and in brackets in hexadecimal.
You can also use the uStrings you mentioned.
As format string.
uString text;
text.format("Text: %d (%x)", number, number);
agk:Print(text.GetStr());
Or as an appended string.
uString text("Text ");
text.Append(agk::Str(number));
// or
// text += agk::Str(number);
agk:Print(text.GetStr());
EDIT:
I have forgotten - If you have received a string with the function agk::??? you must delete this string after using it. (To prevent a memory leak.)
char* num = agk::Str(number);
...
delete num;
EDIT2:
Xaby wrote: "At the moment I am using <vector>, but that is not App Game Kit, that is std-c++"
std::vector and
std::list are very usefull just like
std::map.
Share your knowledge. It\'s a way to achieve immortality.
(Tenzin Gyatso)