implicit declaration of
     int i=0; char **mainp;
    for(i=0;i<2;++i)
     {  mainp[i]=malloc(sizeof(char)*200);
       if(!scanf("%[^#],#",mainp[i]))
         break;
       if(i<2)
       scanf("%[^#],#",mainp[i]);
      }

      why does gcc send me that warnings
      warning: implicit declaration of function ‘scanf’
      warning: incompatible implicit declaration of built-in function ‘scanf’
      warning: ‘mainp’ may be used uninitialized in this function
     why i compile ,i will be met with segmentation fault
implicit declaration of
===

     int i=0; char **mainp;
    for(i=0;i<2;++i)
     {  mainp[i]=malloc(sizeof(char)*200);
       if(!scanf("%[^#],#",mainp[i]))
         break;
       if(i<2)
       scanf("%[^#],#",mainp[i]);
      }

      why does gcc send me that warnings
      warning: implicit declaration of function ‘scanf’
      warning: incompatible implicit declaration of built-in function ‘scanf’
      warning: ‘mainp’ may be used uninitialized in this function
     why i compile ,i will be met with segmentation fault