-
-
Notifications
You must be signed in to change notification settings - Fork 9
Sizeof Value
IsaacShelton edited this page Mar 21, 2022
·
1 revision
sizeof
can be used to get the size of a value in bytes, if it's given a value surrounded by parentheses.
sizeof(my_value)
The resulting value will be a usize
that is the size of the type of the value in bytes.
import basics
func main {
my_integers 100 int
number_of_integers usize = sizeof(my_integers) / sizeof int
printf("Capacity of number_of_integers: %zu integer(s)\n", number_of_integers)
}