package main
import (
"fmt"
"unsafe"
)
func main() {
var flag bool
var n1 int64 = 10
var name string = "小白"
fmt.Printf("int的字节大小", unsafe.Sizeof(n1))
fmt.Println()
fmt.Printf("string的字节大小", unsafe.Sizeof(name))
fmt.Println()
fmt.Printf("bool的字节大小", unsafe.Sizeof(flag))
}
|
请发表评论