V语言 结构体(Structs)
struct Point { x int y int } fn main() { p := Point{ x: 10 y: 20 } println(p.x) // Struct fields are accessed using a dot // & prefix returns a pointer to the struct value. // It's allocated on the heap and is automatically cleaned up // by V at the end of the function, since it doesn't escape. pointer := &Point{x:10, y:10} println(pointer.x) // Pointers have the same syntax for accessing fields }