Browse Source

flag&new

pull/1/head
dewjjj 2 years ago
parent
commit
5cf661bdeb
  1. BIN
      flag0/flag0.exe
  2. 0
      flag0/flag0.go
  3. 14
      new/new.go

BIN
flag0/flag0.exe

Binary file not shown.

0
flag0/flag0.go

14
new/new.go

@ -0,0 +1,14 @@
package main
import "fmt"
func main() {
a := new(int)
fmt.Println(*a) //0
var i int
b := &i
fmt.Println(*b) //0
age := delta(1998, 2021)
fmt.Printf("Age = %d", age)
}
func delta(old, new int) int { return new - old }
Loading…
Cancel
Save