请稍等 ...
×

采纳答案成功!

向帮助你的同学说点啥吧!感谢那些助人为乐的人

正在回答 回答被采纳积分+3

1回答

Moody 2022-09-07 22:32:33
对,一个字节
0 回复 有任何疑惑可以回复我~
  • uccs #1
    int 到底是 1个字节还是 8 个字节,源码中的注释是 bytes,不是代表字节吗
    // Sizeof takes an expression x of any type and returns the size in bytes
    // of a hypothetical variable v as if v was declared via var v = x.
    // The size does not include any memory possibly referenced by x.
    // For instance, if x is a slice, Sizeof returns the size of the slice
    // descriptor, not the size of the memory referenced by the slice.
    // For a struct, the size includes any padding introduced by field alignment.
    // The return value of Sizeof is a Go constant if the type of the argument x
    // does not have variable size.
    // (A type has variable size if it is a type parameter or if it is an array
    // or struct type with elements of variable size).
    func Sizeof(x ArbitraryType) uintptr
    回复 有任何疑惑可以回复我~ 2024-06-23 13:16:56
  • Moody 回复 uccs #2
    对,之前应该是说错了,int是64位
    回复 有任何疑惑可以回复我~ 2024-06-24 14:43:37
问题已解决,确定采纳
还有疑问,暂不采纳
意见反馈 帮助中心 APP下载
官方微信