Strings- Error
#4

Quote:
Originally Posted by Jefff
Посмотреть сообщение
pawn Код:
sizeof(string) returns 4
pawn Код:
sizeof(string[]) returns 128
Thanks, that's it, +rep

-----------

Quote:
Originally Posted by CutX
Посмотреть сообщение
do it like this
pawn Код:
new string[4][128];
    format(string[0], sizeof(string), "BlaBla%i", int);
just "sizeof(string)" without the brackets is enough cuz
the sole name of an array is the pointer to it's 1st element

ps: u don't need the clips when using the keyword "sizeof"
this:
pawn Код:
format(string[0], sizeof string, "BlaBla%i", int);
works fine too
thanks, but the right one is sizeof string[], +rep also since I learned that I don't need the "()"

__________________________________________________ __________________________________________________ _______________________________________________

One last question,
now in this case
pawn Код:
new string[4][128];
I can use sizeof string[]
but what do I do in this case
pawn Код:
enum pData
{
    pPass[20], // what do I do to get the size of this one?
        // .....
    pCash,
    Float:pPosx,
    Float:pPosy,
    Float:pPosz,
    pKills,
    pDeaths,
    pVehnumber,
    Float:pHealth
}
new PlayerData[MAX_PLAYERS][pData];
I don't believe that I can simply use sizeof PlayerData[][] for the size of pPass which is 20
Reply


Messages In This Thread
Strings- Error - by Sarra - 14.08.2014, 18:15
Re: Strings- Error - by CutX - 14.08.2014, 18:24
Re: Strings- Error - by Jefff - 14.08.2014, 20:18
Re: Strings- Error - by Sarra - 16.08.2014, 09:47

Forum Jump:


Users browsing this thread: 1 Guest(s)