Pointer dereference

Report a typo

Obtain the value from the ptr pointer, assign it to the num variable, and finally return the value of num.

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)
}
___

Create a free account to access the full topic