[QUESTION]: Difference between....
#1

Hello,

I was wondering what's the difference between 'NULL' & '0' ?
-I think they're equal but Am I right?

Thanks in advance-
Reply
#2

Quote:

Strings in PAWN (and other languages) are what's called "NULL terminated", this means that when 0 is reached, the string ends. This is not the same as the character "0", represented by the number 48, this is the NULL character, represented by the number 0. This means that you can have a string array 20 cells large but only have a string 3 characters long if the fourth character is the NULL character, signalling the end of the string. You can not however have a string 20 characters long as the NULL character MUST be in the string, so in a 20 cell array you can have a 19 character string and a NULL termination character.

Source : https://sampwiki.blast.hk/wiki/Scripting_Basics
Reply
#3

Null is unknown. Unknown isn't equal to 0. For example, if you'd want a database entry for the amount of pets someone has: if you don't know the answer, you put NULL. If you know he has none, you put 0.
Reply
#4

Quote:
Originally Posted by SilentSoul
Посмотреть сообщение
Quote:
Originally Posted by Vince
Посмотреть сообщение
Null is unknown. Unknown isn't equal to 0. For example, if you'd want a database entry for the amount of pets someone has: if you don't know the answer, you put NULL. If you know he has none, you put 0.
Thanks a lot.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)