Advertisement
Nicksed

Untitled

Jul 26th, 2023
1,127
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Go 0.23 KB | None | 0 0
  1. // What will be the output?
  2.  
  3. type Person struct {
  4.     Name string
  5.     Age  int
  6. }
  7.  
  8. func modifyPerson(p Person) {
  9.     p.Age = 30
  10. }
  11.  
  12. func main() {
  13.     person := Person{Name: "Alice", Age: 25}
  14.     modifyPerson(person)
  15.     fmt.Println(person)
  16. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement