There was an error while loading. Please reload this page.
sizeof can be used to get the size of type in bytes.
sizeof
sizeof Type
The resulting value will be a usize that is the size of the type in bytes.
usize
import basics func main { heap_integer_value *int = malloc(sizeof int) defer free(heap_integer_value) *heap_integer_value = 10 printf("heap_integer_value = %d\n", *heap_integer_value) }
Table of Contents