SA-MP Forums Archive
[FIXED] Char-array with sizeof() as size - Printable Version

+- SA-MP Forums Archive (https://sampforum.blast.hk)
+-- Forum: SA-MP Scripting and Plugins (https://sampforum.blast.hk/forumdisplay.php?fid=8)
+--- Forum: Scripting Help (https://sampforum.blast.hk/forumdisplay.php?fid=12)
+--- Thread: [FIXED] Char-array with sizeof() as size (/showthread.php?tid=421690)



[FIXED] Char-array with sizeof() as size - MP2 - 10.03.2013

pawn Код:
new array[5];

main()
{
    new bool:charArray[sizeof(array) char]; // Line from which errors originate
}
Quote:

error 001: expected token: "]", but found "char"
error 029: invalid expression, assumed zero
error 029: invalid expression, assumed zero
fatal error 107: too many error messages on one line

Compilation aborted.Pawn compiler 3.2.3664 Copyright © 1997-2006, ITB CompuPhase


4 Errors.

Any way to do this? Do I have the syntax wrong or is this just not possible?

Fixed:

pawn Код:
new bool:charArray[(sizeof(array)) char];
Needed wrapping in parenthesis.


Re: [FIXED] Char-array with sizeof() as size - mastermax7777 - 10.03.2013

why the f would u want to use char


Re: [FIXED] Char-array with sizeof() as size - mastermax7777 - 10.03.2013

nice.. -rep 3 for asking a nice question . . herp derp you people suck


Re: [FIXED] Char-array with sizeof() as size - Bakr - 10.03.2013

Perhaps if you didn't ask in the demeanor you did you wouldn't have gotten the negative reputation.

You should also use the search feature. It's neat.


Re: [FIXED] Char-array with sizeof() as size - MP2 - 10.03.2013

Quote:
Originally Posted by mastermax7777
Посмотреть сообщение
why the f would u want to use char
To use a quarter of the memory.

Why do you insist on making posts like these? Can't you learn to be nice?


Re: [FIXED] Char-array with sizeof() as size - mastermax7777 - 19.03.2013

Quote:
Originally Posted by MP2
Посмотреть сообщение
To use a quarter of the memory.

Why do you insist on making posts like these? Can't you learn to be nice?
lol u think i dont know why u like char?

i was asking just for the heck of it.. i am nice and if i say fuck doesnt mean im bad person.. lol

Bakkr stfu .. rep away


Re: [FIXED] Char-array with sizeof() as size - Scenario - 19.03.2013

You're probably one of the most immature people on this forum, mastermax7777. The amount of posts you make that are just complete ignorance and nonsense... I'm surprised you haven't been banned yet!


Re: [FIXED] Char-array with sizeof() as size - mastermax7777 - 19.03.2013

yes superior master fake Cock Big Cluck Godfather
your "mature" grammar doesn't make you better either

I Will Use Commas And Periods. I am YOUR great leader. Look at me Now! Char .. save memory save!! YOU DIDNT USE PACKED ARRAYS U FOOL