This commit is contained in:
a.pivkin
2025-07-11 15:14:40 +03:00
parent 31515dba8d
commit f7620b40f3
10 changed files with 119 additions and 0 deletions
+3
View File
@@ -0,0 +1,3 @@
module main.go
go 1.24.4
+41
View File
@@ -0,0 +1,41 @@
package main
import "fmt"
func main() {
// var variable int = 30
// var pointer *int = &variable
// fmt.Printf("Type of pointer %T\n",pointer)
// fmt.Printf("Value of pointer %v\n",pointer)
// secondPtr := &pointer
// fmt.Println("Pointer to pointer",secondPtr)
// zeroPtr := new(int)
// *zeroPtr += 40
// fmt.Println("Address is ",*zeroPtr)
// a := 10
// c := a
// b := &a
// *b += 2
// c++
// fmt.Printf("Val of A is %d and val of C is %d\n",a, c)
// fmt.Printf("Val of A after changing ref is %d",a)
sample := 1
// samplePtr := &sample
fmt.Println("Sample val is",sample)
kek(sample)
fmt.Println("Sample val is",sample)
}
func kek(val int) {
fmt.Println("Val of val is",val)
val += 100
}