0 votes 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 asked Oct 18, 2017 stblue 767 views answer comment Share Follow See all 3 Comments See all 3 3 Comments reply Prashant. commented Oct 18, 2017 reply Follow Share Answer : 1,4,40 1 votes 1 votes stblue commented Oct 18, 2017 reply Follow Share @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 votes 0 votes Prashant. commented Oct 18, 2017 reply Follow Share 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 votes 1 votes Please log in or register to add a comment.
Best answer 4 votes 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 See all 0 reply Please log in or register to add a comment.