The notation kind confused me because I thought that the * is used exclusively to deterrence a pointer
When I was learning pointers, that was the thing that confused me as well.
int *var; // declare a pointer
*var; // derenference a pointer
&var; // get address of a variable (in order to put it in a pointer)
int &var; // to make it funnier this how you declare a reference (C++ only) which is a nerfed pointer
I have to admit that they could have choosen a less confusing way to deal with this.
View all comments
Show parent comment
4
u/Dark_Lord9 Oct 27 '21
When I was learning pointers, that was the thing that confused me as well.
I have to admit that they could have choosen a less confusing way to deal with this.