17.03.2013, 18:55
There are 4 'chars' per array element, which means sizeof doesn't work as I need it to. If it's 1, 2, 3 or 4 chars, it will return 1. If it's 5, 6, 7 or 8 chars, it will return 2. It only works in 4's. Is there no way to do sizeof on a char-array?
Output: 1 1 2 3 5
pawn Код:
public OnFilterScriptInit()
{
new bool:charArray1[10][1 char];
printf("sizeof: %i", sizeof(charArray1[]));
new bool:charArray2[10][4 char];
printf("sizeof: %i", sizeof(charArray2[]));
new bool:charArray3[10][8 char];
printf("sizeof: %i", sizeof(charArray3[]));
new bool:charArray4[10][9 char];
printf("sizeof: %i", sizeof(charArray4[]));
new bool:charArray5[10][20 char];
printf("sizeof: %i", sizeof(charArray5[]));
return 1;
}