gobyexample/029-structs.go
Mark McGranaghan 354a9d862f reorder
2012-09-21 07:54:20 -07:00

21 lines
297 B
Go

package main
import "fmt"
type Circle struct {
x, y, r float64
}
func main() {
cEmptyPtr := new(Circle)
fmt.Println(cEmptyPtr)
fmt.Println(*cEmptyPtr)
cValue := Circle{x: 1, y: 2, r: 5}
fmt.Println(&cValue)
fmt.Println(cValue)
cOrdered := Circle{1, 2, 5}
fmt.Println(cOrdered)
}