Skip to content

Commit 624b049

Browse files
committed
updates pointer eg
1 parent 3320473 commit 624b049

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

codes/session-1/pointer.go

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,14 @@ func main() {
2727
/**
2828
* Print value of greeting
2929
*/
30-
3130
fmt.Println(*greeting)
31+
32+
/**
33+
* Change pointer value, also change message value
34+
*/
35+
*greeting = "Welcome to the Go world!"
36+
37+
fmt.Println(message);
38+
39+
fmt.Println(*greeting);
3240
}

0 commit comments

Comments
 (0)