The uint
type in Golang is a numeric type that stores unsigned integers.
The following code snippet illustrates how to define a variable of type uint
:
var myVar uint = 100
The following table displays the size of uint
type on 32-bit systems and 64-bit systems:
Platform | Size | Range |
---|---|---|
32-bit system | 32-bit | 0 to 232 - 1 |
64-bit system | 64-bit | 0 to 264 - 1 |
The following example demonstrates how to define and print a uint
variable:
package mainimport "fmt"func main() {var myVar uint = 222fmt.Printf("%d",myVar)}
Free Resources