Which of the following is NOT a method of the io.Writer interface in Go?
What is the output of the following code snippet?
package main
import "fmt"
func main() {
x := []int{1, 2, 3}
y := &x
fmt.Println((*y)[0])
}
What is the output of the following Go code?
package main
import "fmt"
func change(p *int) {
*p = 20
}
func main() {
x := 10
p := &x
change(p)
fmt.Println(x)
}
What is the output of the following Go code?
package main
import "fmt"
func main() {
x := 10
p := &x
fmt.Println(*p)
*p = 20
fmt.Println(x)
}
What is the output of the following code snippet?
package main
import "fmt"
func main() {
x := 5
y := &x
fmt.Println(y)
}
What is the output of the following code?
package main
import "fmt"
func main() {
var ptr *int
var num int = 10
ptr = &num
fmt.Printf("Value of ptr: %d\n", *ptr)
}
What is the output of the following Go code?
package main
import "fmt"
func change(p *int) {
*p = *p + 10
}
func main() {
x := 10
p := &x
fmt.Println(*p)
change(p)
fmt.Println(*p)
}
What is the output of the following Go code?
package main
import "fmt"
func swap(p, q *int) {
*p, *q = *q, *p
}
func main() {
x := 10
y := 20
p := &x
q := &y
swap(p, q)
fmt.Println(x, y)
}
Which of the following statements is true about the fmt.Stringer interface in Go?
What is the purpose of the sort.Interface interface in Go?