Obtain the value from the ptr pointer, assign it to the num variable, and finally return the value of num.
Pointers
Pointer dereference
Report a typo
Write a program in Go
package main
import "fmt"
func solve(ptr *int) int {
var ? = ? // assign the value of the pointer 'ptr' to the variable 'num'
return ? // return the value of the variable 'num'
}
// DO NOT change the contents of the main function!
func main() {
var num = new(int)
fmt.Scan(num)
var test = solve(num)
fmt.Println(test)
}
___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.