You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
226 B
14 lines
226 B
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 }
|