0
Go practice problem
The given code declares a Timer struct, which is initialized in main(). You need to add a reset functionality to the program. The reset() function needs to take a pointer to the struct as its argument and reset the seconds value to 0.
2 Respostas
0
package main
import "fmt"
type Timer struct {
id string
seconds int
}
func main() {
var x int
fmt.Scanln(&x)
t :=&Timer{"ABC", x}
func reset("ABC",0)
fmt.Println(t)
}
0
Expected out is (ABC 0)