19.05.2013, 16:42
Код:
stock strcatEx(fstring[], ...) { new temp[2]; const STATIC_ARGS = 1; fstring[0] = EOS; for(new i = STATIC_ARGS, args = numargs(); i != args; ++i) { new x, string[128], chari = -1; while(chari != 0) { chari = getarg(i, x); format(temp, sizeof temp, "%c", chari); strcat(string, temp); x++; if(!chari) break; } format(fstring, 128, "%s%s%s", fstring, (fstring[0] != EOS) ? (" ") : (""), string); } return 1; }
Код:
new result[70]; strcatEx(result, "This", "is", "Sparta!"); print(result);