816 views
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 

1 Answer

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 *.

No related questions found