Quote:
Originally Posted by blAck.
Since I'm new, I was wondering what does 'sz' stands for?
I've seen some stuff like szName, szNameReceiver, szAmount, szCommand...
Please can somebody explain this to me?
|
"
string,
zero-terminated"
Meaning that the end of the string is denoted by a value of zero. This is why you must always size an array being used as a string with one extra element (for the zero-termination).
Code:
szString[7] = "hello"
string[0] = 'h' = 104
string[1] = 'e' = 101
string[2] = 'l' = 108
string[3] = 'l' = 108
string[4] = 'o' = 111
string[5] = EOS = 0
string[6] =
I didn't show a value for string[6] because it is ignored because it comes after the zero-termination; it could be any value.
Prefixing is not required but because Pawn is typeless, it is generally recommended to prefix your variable so that people, including yourself, know what you are actually using the variable for.
Other often used prefixes:
Code:
integer: i
boolean: b
Float: f
string: sz
For more about basic Pawn programming, you should look through the tutorials.
This one is really good. Other tutorials can be found
here.
__________________