fork download
  1. #include <stdio.h>
  2.  
  3. // это тип main такая
  4. static int not_main(int argc, char **argv)
  5. {
  6. return 0;
  7. }
  8.  
  9. int main(void)
  10. {
  11. // > это указатель на массив указателей. уходи.
  12.  
  13. // массив укозателей
  14. char *array[3] = { "one", "two", NULL };
  15.  
  16. // укозатель на массив укозателей
  17. char *(*array_ptr)[3] = &array;
  18.  
  19. // ниработает
  20. not_main(2, array_ptr);
  21. }
  22.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function ‘main’:
prog.c:20:17: error: passing argument 2 of ‘not_main’ from incompatible pointer type [-Werror=incompatible-pointer-types]
     not_main(2, array_ptr);
                 ^~~~~~~~~
prog.c:4:12: note: expected ‘char **’ but argument is of type ‘char * (*)[3]’
 static int not_main(int argc, char **argv)
            ^~~~~~~~
cc1: all warnings being treated as errors
stdout
Standard output is empty