SA-MP Forums Archive
strcpy problem - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: strcpy problem (/showthread.php?tid=345598)



strcpy problem - BaubaS - 25.05.2012

I have a problem with strcpy, it always prints null

#define strcpy(%0,%1,%2) strcat((%0[0] = '\0', %0), %1, %2)

pawn Код:
new TestEx[MAX_PLAYERS][10],
    Test[10] = "test12345"
;

strcpy(TestEx[1], Test, strlen(Test) + 1);
printf("Bandymas: %s", TestEx[1]);
strcpy(TestEx[1], Test);
printf("Bandymas #2: %s", TestEx[1]);