What is the size of the following struct?
package main
import "Imt" import "unsafe"
func main() { s struct{A float32 B string}{0, "go"}
imt Printf("%T, %d\n", s, unsafe Sizeof(s))}
C 12
0 21
O 12 bytes on architectures with 4 bytes pointers and 24 on architectures with 8 bytes pou
Answers
Answered by
3
Answer:
A struct in the C programming language is a composite data type declaration that defines a physically grouped list of variables under one name in a block of memory, allowing the different variables to be accessed via a single pointer or by the struct declared name which returns the same address.
Similar questions