0 votes 0 votes #include<stdio.h> main() { static char *s[]={"black","white","pink","violet"}; char **ptr[]={s+3,s+2,s+1,s},***p; p=ptr; ++p; printf("%s",**p+1); } if i dont use static here , compiler throws error why plz explaain sumit goyal 1 asked Jun 29, 2017 sumit goyal 1 816 views answer comment Share Follow See all 2 Comments See all 2 2 Comments reply Rupendra Choudhary commented Jun 29, 2017 reply Follow Share I don't find any reason of error if static type is not used. Even declaring static is of no use here. Can you make sure if it's really causing error. then tell. 0 votes 0 votes sumit goyal 1 commented Jun 30, 2017 reply Follow Share got it , iam using turbo c therefore error occurs , but in gcc it runs fine 0 votes 0 votes Please log in or register to add a comment.
1 votes 1 votes These warning are C++ Warning not C . C Compiler Output- C++ Compiler Output- program give Warning because string literals are char const* types in C++.To solve this problem use char const * instead of char *. Deepak Kumar 12 answered Jun 29, 2017 Deepak Kumar 12 comment Share Follow See all 2 Comments See all 2 2 Comments reply sumit goyal 1 commented Jun 30, 2017 reply Follow Share thanks bro , in turbo c only it cause error and it will not run , but in gcc it works fine thanks for posting :) 0 votes 0 votes Deepak Kumar 12 commented Jun 30, 2017 reply Follow Share Turbo C is a primitive, non-standard, pre-historic C++ compiler.Those warning are came in C++ Compiler ...So used GCC Compiler . 0 votes 0 votes Please log in or register to add a comment.