Raised This Month: $12 Target: $400
 3% 

Solved What are the default Variable Values?


Post New Thread Reply   
 
Thread Tools Display Modes
Author Message
DJPlaya
Senior Member
Join Date: Nov 2014
Location: Germany
Old 09-30-2019 , 19:16   What are the default Variable Values?
Reply With Quote #1

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 = ""?
__________________
My biggest Projects: Kigen AC Redux, Forlix Floodcheck Redux

Last edited by DJPlaya; 10-02-2019 at 15:45.
DJPlaya is offline
Send a message via Skype™ to DJPlaya
impossible_cc
Senior Member
Join Date: Sep 2018
Location: Ukraine
Old 10-01-2019 , 07:27   Re: What are the default Variable Values?
Reply With Quote #2

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.
__________________
impossible_cc is offline
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -4. The time now is 05:30.


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