Answer to Question #44246 in Other Programming & Computer Science for Vijayasurya
1. int i=50
2. int *ptr
3. int **ptrptr
Now, why does a pointer variable that will store the address of another pointer variable have to be
declared with double ** ?? why will just one * symbol not do?
AND also if i have to declare another pointer that will store the address of ptrptr, should i have to
declare it with *** symbols? or how many?
1.The pointer to pointer variable is indicated with double ** so that you could see that this pointer stores address of another pointer.
If you declare all the pointers (regardless of their depth) with a single star (*) you would be confused soon enough, even if you're dealing with a simple code, as no one can hold everything in the memory.
2. Pointer which stores address of a pointer, which holds address of another pointer should be declared with 3 stars (***). in fact stars quantity increases arithmetically with increasing of depth.
Hope this helps.
Need a fast expert's response?Submit order
and get a quick answer at the best price
for any assignment or question with DETAILED EXPLANATIONS!