0 0 votes #include <stdio.h> int main() { int a[] = {50, 60, 10, 30, 40, 20 }; int *b[] = {a+3, a+4, a, a+2, a+1, a+5 }; int **c = b; c++; printf("%u, %u, %u\n", c-b, *c - a, **c); return 0; } Programming in C programming-in-c output pointers array + – stblue 1.3k views answer comment Share Follow Print See all 3 Comments 3 3 Comments reply Prashant. commented Oct 18, 2017 reply Follow flag Answer : 1,4,40 1 1 replyShare stblue commented Oct 18, 2017 reply Follow flag @Prashant. I am not getting this, when we do, c-b why we got 1 as answer, likewise when we do *c-a why we got 4 as answer ? Here i modified to programme to see the address, i think c-b should be 8 and *c-a should be 16. Where i am going wrong ? 0 0 replyShare Prashant. commented Oct 18, 2017 reply Follow flag 3347544000 is nothing the base address of the array b. 3347544008 is nothing the 2nd element address of the array b. which is contain by c after c++. 3347544008 - 3347544000 = 8 but we know pointer take 8 byte here . so divide by size of pointer is needed. so 8/8= 1 1 1 replyShare Please log in or register to add a comment.
Best answer 4 4 votes Output will be 1,4,40 Ankit Srivastava 7 answered Oct 18, 2017 • selected Oct 18, 2017 by srestha Ankit Srivastava 7 comment Share Follow 0 reply Please log in or register to add a comment.