Add pointer and password app

This commit is contained in:
Archer Fox
2025-03-01 22:20:45 +03:00
parent 1b71b5e8e3
commit 850430b62e
3 changed files with 38 additions and 0 deletions

20
go-demo-4/main.go Normal file
View File

@@ -0,0 +1,20 @@
package main
import (
"fmt"
)
func main() {
a := [4]int{1, 2, 3, 4}
reverse(&a)
fmt.Println(a)
var n *int
fmt.Println(*n)
}
func reverse(arr *[4]int) {
for idx, val := range *arr {
(*arr)[len(arr)-1-idx] = val
}
}