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
  • 14

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
  • 12,097
  • 11
  • 59
  • 124
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,818
  • 3
  • 43
  • 55