21.12.2013, 23:06
The only thing that doesn't fit with your code is that because the loop ends at 9
The case is easy, each string needs to end with a EOS (0) character
You overwrite the last cell and therefore it shows data beyond you array till it finds a 0
Since you created string before you will see the value of the "RegisterPassword"
Also if you want to create a plain array with only one sign you could do it like that
Quote:
Код:
[00:34:33] [DEBUG]{C0C0C0}tmpPassStr[10] = ']]]]]]]]]]]wewewewewewe' |
You overwrite the last cell and therefore it shows data beyond you array till it finds a 0
Since you created string before you will see the value of the "RegisterPassword"
Also if you want to create a plain array with only one sign you could do it like that
pawn Код:
new
tmpPassStr2[11] = { ']', ... }
;
if(strlen(inputtext) < sizeof tmpPassStr2) {
tmpPassStr2[strlen(inputtext)] = EOS;
} else {
tmpPassStr2[sizeof tmpPassStr2 - 1] = EOS;
}