[Tutorial] About Format and Printf
#8

Quote:
Originally Posted by newbie scripter
Посмотреть сообщение
2. the second argument is used to store the data we get from the function to the string we mention
3. idk much of it xD. let me try . it is used to get the size of (or) the No. of characters used in that string??
5. '@' ?

"This forum requires that you wait 240 seconds between posts. Please try again in 6 seconds."
About 2.:
I've already mentioned that... I was talking about the limits...
You just did
pawn Код:
new name[32], str [64];
GetPlayerName(playerid,name,sizeof(name));
pawn Код:
name[32]
Do you think, that this can be optimized?
Quote:

Hint: See SA:MP limits and there is a well know definition used in many scripts.

About 3.:
sizeof can be used that way aswell:
pawn Код:
sizeof something
pawn Код:
(sizeof something)
pawn Код:
sizeof (something)
pawn Код:
(sizeof(something))
so you can't say, that sizeof only relies on brackets.

During pre-compilation sizeof simply returns the amount of cells an array has been defined.

pawn Код:
new something[16];
print(" \"sizeof something\" equals "#sizeof something".");
Prints
Код:
 "sizeof something" equals 16.
About 5.:
This is correct.


Edit:
About 4.:
It would be very useful to explain this in the main post for other people.
Reply


Messages In This Thread
About Format and Printf - by newbie scripter - 05.11.2013, 12:12
Re: About Format and Printf - by newbie scripter - 06.11.2013, 10:42
Re: About Format and Printf - by CrazyChoco - 06.11.2013, 11:21
AW: About Format and Printf - by BigETI - 06.11.2013, 11:22
Re: About Format and Printf - by newbie scripter - 06.11.2013, 11:30
AW: Re: About Format and Printf - by BigETI - 06.11.2013, 12:52
Re: About Format and Printf - by newbie scripter - 06.11.2013, 13:04
AW: Re: About Format and Printf - by BigETI - 06.11.2013, 13:27
Re: About Format and Printf - by newbie scripter - 06.11.2013, 13:39
AW: About Format and Printf - by BigETI - 06.11.2013, 14:39

Forum Jump:


Users browsing this thread: 1 Guest(s)