fork(1) download
  1. #include <stdio.h>
  2.  
  3. int len(const char **str) {
  4. return (*str)[0];
  5. }
  6.  
  7.  
  8. int main() {
  9.  
  10.  
  11. char *str = "lala";
  12. char **pStr = &str;
  13.  
  14. printf("%d\n", len(pStr));
  15. return 0;
  16. }
  17.  
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.c: In function 'main':
prog.c:14:20: error: passing argument 1 of 'len' from incompatible pointer type [-Werror=incompatible-pointer-types]
 printf("%d\n", len(pStr));
                    ^
prog.c:3:5: note: expected 'const char **' but argument is of type 'char **'
 int len(const char **str) {
     ^
cc1: all warnings being treated as errors
stdout
Standard output is empty