Currently I have this:
- Code: Select all
const char *name = "item";
const char *param = ".defense";
char buf[32];
sprintf( buf, "%s%d%s", name, selectedItem, param );
defense = buf;
However it seems to give random numbers as the result, any reason for this?