Array size
#1

Hello guys. I've a problem with 2 arrays: inputtext and vInfo[id-1][Name] (vInfo[id-1][Name] size is [30]).
So when I put this in my script:
pawn Код:
vInfo[id-1][Name] = inputtext;
I recieve an error, that array sizes do not match. What should I do?
Reply
#2

https://sampwiki.blast.hk/wiki/Strcat
Reply
#3

And how should it help me?
Reply
#4

You can copy a string to another using strcat, memcpy, format (not recommended).

pawn Код:
strcpy(vInfo[id-1][Name], inputtext, 30);
and:
pawn Код:
#define strcpy(%0,%1,%2) strcat((%0[0] = '\0', %0), %1, %2)
Reply
#5

Thanks Konstantinos. + rep
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)