Original Post
🔒 Locked
unsigned????
Advertisement
Normal variables are signed, this means that one bit on the variable is used to determine whether the variable is positive or negative. If you use an unisgned variable, you cannot have negative numbers, but the highest positive number is doubled.
eg.
int my_int; // min = -2147483648 max = 2147483648
signed my_int; // as signed int (variables are implicitly signed)
unsigned int my_int; // min = 0 max = 4294967296
eg.
int my_int; // min = -2147483648 max = 2147483648
signed my_int; // as signed int (variables are implicitly signed)
unsigned int my_int; // min = 0 max = 4294967296
Const is analogous to a variable, except that it''s value is initialized at declaration and can never change! You want to do this often with string constants and such. it is a value that will always be the same and that you need to be accessible, but you want to make sure it is not accidentally changed, thereby screwing your prog up.
-----------------------------
The sad thing about artificial intelligence is that it lacks artifice and therefore intelligence.
-----------------------------
The sad thing about artificial intelligence is that it lacks artifice and therefore intelligence.
As a note: you can''t have an unsigned floating point variable.
[Resist Windows XP''s Invasive Production Activation Technology!]
[Resist Windows XP''s Invasive Production Activation Technology!]
Topic Locked
This topic has been locked by a moderator. New replies are not allowed.
Sign in to reply to this topic.
Advertisement