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.
33 lines
482 B
33 lines
482 B
6 years ago
|
## Point
|
||
6 years ago
|
|
||
6 years ago
|
### Instructions
|
||
6 years ago
|
|
||
|
Create a `.go` file and copy the code below into our file
|
||
|
|
||
|
- The main task is to return a working program.
|
||
|
|
||
|
```go
|
||
|
func setPoint(ptr *point) {
|
||
6 years ago
|
ptr.x = 42
|
||
|
ptr.y = 21
|
||
6 years ago
|
}
|
||
|
|
||
|
func main() {
|
||
6 years ago
|
points := &point{}
|
||
|
|
||
|
setPoint(points)
|
||
6 years ago
|
|
||
6 years ago
|
fmt.Printf("x = %d, y = %d",points.x, points.y)
|
||
|
fmt.Println()
|
||
6 years ago
|
}
|
||
|
```
|
||
|
|
||
6 years ago
|
### Expected output
|
||
6 years ago
|
|
||
|
```console
|
||
|
student@ubuntu:~/piscine/test$ go build
|
||
|
student@ubuntu:~/piscine/test$ ./test
|
||
6 years ago
|
x = 42, y = 21
|
||
6 years ago
|
student@ubuntu:~/piscine/test$
|
||
6 years ago
|
```
|