mirror of https://github.com/01-edu/public.git
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.
Augusto
4eced704b8
|
3 years ago | |
---|---|---|
.. | ||
README.md | 3 years ago |
README.md
point
Instructions
Create a new directory called point
.
-
The code below has to be copied in a file called
main.go
inside thepoint
directory. -
The necessary changes have to be applied so that the program works.
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)
}
Usage
$ go run .
x = 42, y = 21
$