I haven't seen your reply coz I was busy. No, assigning a value to a pointer variable in Go without using the dereferencing operator * only changes the value of the pointer itself, not the value pointed to by the pointer. To change the value of the pointed-to variable, you need to dereference the pointer using the * operator.
No worries and thanks Gaurav Shukla. I like to read these articles on my phone sometimes and I could have just tested it on a computer. But thank you for the explanation and theory.
Gemma Black
I haven't started with Go yet so this was helpful.
Would this remove the pointer/reference then from the
ptrvariable tox...ptr = 21... when the star syntax is not used?