Difference between revisions of "Script/BasicDataTypes"
From SF3
(→The '?' Type) |
|||
(8 intermediate revisions by 2 users not shown) | |||
Line 1: | Line 1: | ||
== Basic Data Types == | == Basic Data Types == | ||
− | |||
{|class="wikitable" | {|class="wikitable" | ||
Line 41: | Line 40: | ||
|} | |} | ||
− | < | + | == The '?' Type == |
+ | A question mark (<code>?</code>) in place of a regular type name in ''AngelScript'' means that '''any''' type may be passed in place of that type. <br/> | ||
+ | For those familiar with C/C++, this is the equivalent of <code>void*</code>. | ||
+ | |||
+ | When storing a value as <code>?</code>, the type of the value is lost. In order to interact with the value again, it must be cast back into the original type. Casting it into anything other than the original type will most likely result in the program crashing. |
Latest revision as of 11:28, 10 October 2016
Basic Data Types
type | min value | max value |
int8 | -128 | 127 |
int16 | -32,768 | 32,767 |
int | -2,147,483,648 | 2,147,483,647 |
int64 | -9,223,372,036,854,775,808 | 9,223,372,036,854,775,807 |
uint8 | 0 | 255 |
uint16 | 0 | 65,535 |
uint | 0 | 4,294,967,295 |
uint64 | 0 | 18,446,744,073,709,551,615 |
The '?' Type
A question mark (?
) in place of a regular type name in AngelScript means that any type may be passed in place of that type.
For those familiar with C/C++, this is the equivalent of void*
.
When storing a value as ?
, the type of the value is lost. In order to interact with the value again, it must be cast back into the original type. Casting it into anything other than the original type will most likely result in the program crashing.