/*A PROGRAM TO SEE BEHAVE OF ARRAY OF POINTER & ALSO WHILE PUTTING ADDRESS OF ARRAY OF POINTER INTO DOUBE POINTER*/
//IN ARRAY OF POINTER,POINTER HAS SOME ADDRESSES OF ARRAYS IN CONTINOUS FORM ...IN ARRAYS NO. OF STRINGS ARE TO BE PUTTED...//
#include<stdio.h>
int main()
{
printf("\n_____________________________\n");
char *s[]={"black","blue","red","green"};
printf("%s\n",s[0]);//as a base address s[0]
printf("%s\n",s[1]);//will print blue
printf("%s\n",s[2]);//will prit red
printf("%s\n",s[3]);//will print green
printf("\n_____________________________\n");
printf("%s\n",*(s+0));//as a base address s[0]
printf("%s\n",*(s+1));//will print blue//bcz it has base address of blue...
printf("%s\n",*(s+2));//will print red
printf("%s\n",*(s+3));//will print green
printf("\n______________c_______________\n");
printf("%c\n",*(*(s+0)+2));//as a base add s[0],,,,add 1 to ascii value of b
printf("%c\n",*(*(s+1)+2));//will print a single character...base address character & its value is ++mented by 2....so instead of...PRINTING b it will print a leaving l of black string..//
printf("%c\n",*(*(s+2)+0));//will print r of red
printf("%c\n",*(*(s+3)+3));//will print e of green..//
char **ptr;
ptr=s;//address of s is put into ptr...which is double pointer//
printf("\n+++++++++++++++++++++++++++++\n");
printf("%s",(ptr[0]));//WILL HAVE ADDRESS OF 1ST ARRAY//
printf("%s",(ptr[1]));//WILL HAVE ADDRESS OF 2ND ARRAY//
printf("%s",(ptr[2]));//WILL HAVE ADDRESS OF 3RD ARRAY//
printf("%s",(ptr[3]));//WILL HAVE ADDRESS OF 4TH ARRAY//