2 votes 2 votes # include <stdio.h> int main() { static int a[ ] ={90, 98, 99, 96, 84, 70}; static int *p[ ]={a+2, a+1, a, a+3, a+4, a+5}; static int **S={p+4, p+5, p+1, p, p+2, p+3}; int *** ptr; ptr=S+2; printf(“%d”, ***(ptr+3)-**(p+1)); } Programming in C programming-in-c + – gaurav9822 asked Aug 21, 2016 • edited Sep 21, 2016 by go_editor gaurav9822 638 views answer comment Share Follow See 1 comment See all 1 1 comment reply papesh commented Aug 21, 2016 reply Follow Share -2 should be ans... 0 votes 0 votes Please log in or register to add a comment.
6 votes 6 votes Here there is a typo **S Should be array It should be **S[ ]-2 is Ans Rajesh Pradhan answered Aug 21, 2016 • edited Aug 21, 2016 by Rajesh Pradhan Rajesh Pradhan comment Share Follow See all 3 Comments See all 3 3 Comments reply srestha commented Aug 21, 2016 reply Follow Share here p and s both are double pointer. Both have same useage, right? what is the use of using static int to array or pointers here? Only int a[ ] , int *p[ ] ,or int **S can give here same output. Am I right? 0 votes 0 votes Rajesh Pradhan commented Aug 21, 2016 reply Follow Share Thanks for Ur Comment Respected @srestha There is a typo in this question. **S should be array means **S[ ]. Yes U r abs Right...@srestha Here Static has no significance if we remove it also it will give same result. Bcz Static has local Scope like auto only and Here lifetime has no importance. 0 votes 0 votes Arjun commented Aug 21, 2016 reply Follow Share No, static has a usage here. Many people seeing it will leave the question unanswered :) Actually in no C program any variable being declared static in main is not useful. Because Calling main from a C program is undefined behaviour. Scope of a variable defnied inside main (or any function) is inside main only. Usually we declare a variable static to ensure it has a live memory (lifetime) until program ends execution. Useful for preserving values across function calls. to restrict a global variable scope to within the compilation unit. This allows the same variable name to be used in a different compilation unit as global and then all the units can be linked together to make the executable. 2 votes 2 votes Please log in or register to add a comment.