array sizes do not match, or destination array is too small
#1

Hi, I'm getting this error
Код:
error 047: array sizes do not match, or destination array is too small
at this line
Код:
MapInfo[0][Name] = "CS_TEST";
Even if I leave it blank it gives me that error or if I use strcat then it still stays empty. Everything is OK, I have
Код:
Name[20]
in the enumerator so it should be working. What's up?

EDIT: I added size to strcat and it works now, but why can't I just do MapInfo[0][Name] = ...?
Reply
#2

Because, in PAWN, strings are arrays, so you'd probably have to do:
PHP код:
MapInfo[0][Name] = {'C''S''_''T''E''S''T''\0'}; 
Reply
#3

Quote:
Originally Posted by PawnHunter
Посмотреть сообщение
Because, in PAWN, strings are arrays, so you'd probably have to do:
PHP код:
MapInfo[0][Name] = {'C''S''_''T''E''S''T''\0'}; 
I know, but it's still usually possible to do that. Also I tried your method and it gives the same error. :P
Reply
#4

No clue why but "arrays" from an enum are treated different than normal arrays

It only works if the source and destination have the same size
PHP код:
new name[20];
name "CS_TEST"// well that works for normal arrays
MapInfo[0][Name] = name// same size 
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)