Skip to content

Alignof

Isaac Shelton edited this page Apr 8, 2022 · 2 revisions

Alignof Type

alignof can be used to get the minimum alignment of type in bytes.

alignof Type

Result Type

The resulting value will be a usize that is the minimum alignment of the type in bytes.

Usage Example

import basics

func main {
    printf("Alignment of String is %zu bytes\n", alignof String)
}
Alignment of String 8 bytes
Clone this wiki locally