Question: use only allowed function point / main . go github.com / 0 1 - edu / z 0 1 . PrintRune# 4 , - -

use only allowed function point/main.go
github.com/01-edu/z01.PrintRune#4,--no-lit=[1-9]
Instructions
Create a new directory called point.
The code below must be copied into a file called main.go inside the point directory.
The necessary changes must be applied so that the program works.
The function setPoint() must work with int.
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
",points.x, points.y)
}
Usage
$ go run .
x =42, y =21
$

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Programming Questions!