uint32_t and int32_t

sawex

Premium User
Premium User
Joined
Jan 31, 2009
Messages
43
Reaction score
4
Can someone told me what is the difference between int32_t and uint32_t, and what i should to use if it will be using to check how many hp you are regenerate.
 

Delirium

OTLand veteran & ex mod
Premium User
Joined
May 28, 2007
Messages
3,277
Reaction score
129
Location
Athens, Greece
int32_t is an integer of 32bits and uint32_t is an unsigned integer of 32 bits ^^
 

slawkens

Developer
Premium User
Joined
Aug 27, 2007
Messages
2,844
Reaction score
362
Location
Germany
Here you have something related to topic: Data Type Ranges (C++)

Simplest: uint32_t cannot hold negative values, but it can hold 2x higher number than int32_t (2 * 2,147,483,647 + 1 = 4,294,967,295), uint32_t range is 0 - 4,294,967,295.

int32_t can hold values from –2,147,483,648 to 2,147,483,647
 
OP
sawex

sawex

Premium User
Premium User
Joined
Jan 31, 2009
Messages
43
Reaction score
4
If i need number between 25 and 150 can i use uint8_t and it will be oki, and this don't take to much memory?
 
Last edited by a moderator:
Top