07.12.2011, 14:19
Why would you want to clear the entire string? Just end the string once you are done replacing characters.
pawn Код:
new x[16];
x[0] = '1';
x[1] = '2';
x[2] = '3';
x[3] = '4';
x[4] = '5';
//Expected result of x: "5 12345", actual result: "5 12345"
printf("%d %s",strlen(x),x);
x[0] = '2';
x[1] = '3';
x[2] = '4';
x[3] = '\0';
//Expected result of x: "3 234", actual result: "3 234"
printf("%d %s",strlen(x),x);