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.
 
 
 
 
 
 

607 B

point

Instructions

Create a .go file.

  • The code below has to be copied in that file.

  • The necessary changes have to be applied so that the program works.

  • The program must be submitted inside a folder with the name point.

Code to be copied

func setPoint(ptr *point) {
	ptr.x = 42
	ptr.y = 21
}

func main() {
	points := &point{}

	setPoint(points)

	fmt.Printf("x = %d, y = %d\n",points.x, points.y)
}

Expected output

student@ubuntu:~/piscine-go/test$ go build
student@ubuntu:~/piscine-go/test$ ./test
x = 42, y = 21
student@ubuntu:~/piscine-go/test$