Исходники и презентации
This commit is contained in:
18
lessons/structs/struct_alignment_2/main.go
Normal file
18
lessons/structs/struct_alignment_2/main.go
Normal file
@ -0,0 +1,18 @@
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"unsafe"
|
||||
)
|
||||
|
||||
type data1 struct {
|
||||
aaa bool
|
||||
bbb [1023]byte
|
||||
ccc bool
|
||||
}
|
||||
|
||||
func main() {
|
||||
d := data1{}
|
||||
fmt.Println(unsafe.Sizeof(d))
|
||||
fmt.Println(unsafe.Alignof(d))
|
||||
}
|
||||
Reference in New Issue
Block a user