Array problem.
#1

Hello guys, I'm trying to make a log for my temporary ban system, but I've got such a little issue with it.
However, everything seems okey, but i've got some little errors:

PHP код:
C:\Users\Killer\Desktop\test\gamemodes\DMSOURCE.pwn(1939) : error 047: array sizes do not match, or destination array is too small
C
:\Users\Killer\Desktop\test\gamemodes\DMSOURCE.pwn(1971) : error 047: array sizes do not match, or destination array is too small
C
:\Users\Killer\Desktop\test\gamemodes\DMSOURCE.pwn(2003) : error 047: array sizes do not match, or destination array is too small 
Lines :

~1939 - 1971 - 2003~ :
PHP код:
banned[TbanID][reason_banned] = inputtext
Information: I put this code under OnDialogResponse.

Hope getting some advices as soon as possible.

- KillerDVX.
Reply
#2

You can't copy a string like that because a) the size of the input string is not known at compile time and b) the number of dimensions do not match. For array assignments the array on the left must have a size equal or greater than the size of the array on the right and additionally both arrays must have an equal number of dimensions.

Use strcpy/strcat/memcpy.
Reply
#3

So.. Could i replace for exemple the inputtext format into one of these : "strcpy/strcat/memcpy" ?

EDIT: Got this ! Thanks vince.

REP+.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)