Pointer to Pointer
suggest changeIn C, a pointer can refer to another pointer.
#include <stdio.h> #include <stdlib.h> int main(void) { int A = 42; int* pA = &A; int** ppA = &pA; int*** pppA = &ppA; printf("%d", ***pppA); /* prints 42 */ return EXIT_SUCCESS; }
But, reference-and-reference directly is not allowed.
#include <stdio.h> #include <stdlib.h> int main(void) { int A = 42; int* pA = &A; int** ppA = &&A; /* Compilation error here! */ int*** pppA = &&&A; /* Compilation error here! */
...
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents