AlliedModders

AlliedModders (https://forums.alliedmods.net/index.php)
-   Scripting (https://forums.alliedmods.net/forumdisplay.php?f=107)
-   -   Solved What are the default Variable Values? (https://forums.alliedmods.net/showthread.php?t=318932)

DJPlaya 09-30-2019 19:16

What are the default Variable Values?
 
What are the default Values of all Variable Types? Are they identical to some other Language?
In my understanding, writing bool bSomething; as Code will be changed to bool bSomething = false; by the Compiler.
If bool = false and Handle = INVALID_HANDLE, is an Integer = 0, Float = 0.0 and char = ""?

impossible_cc 10-01-2019 07:27

Re: What are the default Variable Values?
 
for any primitive data type
default(type) = view_as<type>(0)

Handle = view_as<Handle>(0);
(same as null or INVALID_HANDLE)

bool = false, float = 0.0, char = view_as<char>(0), etc.


All times are GMT -4. The time now is 10:14.

Powered by vBulletin®
Copyright ©2000 - 2024, vBulletin Solutions, Inc.