String trouble
#1

I have no idea what is happening:
pawn Код:
new tmp[257];
cache_get_row(j, 0, tmp);
strcat(HelpDialogs[i][name], tmp);
printf("Cache: %s Array: %s", tmp, HelpDialogs[i][name]);
Result:
Quote:

Cache: Correct value Array:

WAT
pawn Код:
HelpDialogs[i][name] = tmp;
// error 047: array sizes do not match, or destination array is too small
format(HelpDialogs[i][name], sizeof(HelpDialogs[i][name]), "%s", tmp);
/*
** error 001: expected token: "]", but found "-identifier-"
** warning 215: expression has no effect
** error 001: expected token: ";", but found "]"
** error 029: invalid expression, assumed zero
** fatal error 107: too many error messages on one line
*/
All of my wat. This makes no sense, the 'name' is certainly big enough, it's bigger than tmp for sure. Why is this happening to me?
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)