0

What is the difference between char *val and char ***val. I know what pointers are but can not find anywhere what this triple star notation means.

bluerubez
  • 300
  • 2
  • 13

2 Answers2

2

Each star you add is another pointer, which means that char *** val is a pointer to another pointer that points to a char pointer

CIsForCookies
  • 10,991
  • 7
  • 44
  • 96
1

The three stars/asterisks mean nothing special. Each of the stars indicate a level of indirection.

Let me exemplify:

char *val is a char pointer called val.

char **val is a pointer to a char pointer called val.

char ***val is a pointer to a pointer to a char pointer called val.

So an asterisk for each pointer level.

Morten Jensen
  • 5,555
  • 3
  • 41
  • 54