02.01.2015, 15:54
ustr is way too small and strd too big
strd could be around 43
and ustr probably something close to 380
lstr could also be around 85 isntead of 400
just estimate the maximum size for each string, that'll help in the future too.
for example, something like this
here it's
"hello " -> 6 chars
"%s" which equals to 24(max-name) -> 24 chars
"!" 1 char
'\0' 1cahr
so the optimal size of str would be 32
not too much adn not too less, just right.
strd could be around 43
and ustr probably something close to 380
lstr could also be around 85 isntead of 400
just estimate the maximum size for each string, that'll help in the future too.
for example, something like this
pawn Код:
format(str,sizeof str,"hello %s!",name);
"hello " -> 6 chars
"%s" which equals to 24(max-name) -> 24 chars
"!" 1 char
'\0' 1cahr
so the optimal size of str would be 32
not too much adn not too less, just right.