I am working with C and I’m a bit rusty. I am aware that * has three uses:
- Declaring a pointer.
- Dereferencing a pointer.
- Multiplication
However, what does it mean when there are two asterisks (**) before a variable declaration:
char **aPointer = ...
Thanks,
Scott
It declares a pointer to a
charpointer.The usage of such a pointer would be to do such things like:
Here’s another example:
Use of
**with arrays:The
[]operator on arrays does essentially pointer arithmetic on the front pointer, so, the wayarray[1]would be evaluated is as follows:This is one of the reasons why array indices start from
0, because: