记录详情

Compile Error

/in/foo.c: In function 'main':
/in/foo.c:8:2: warning: 'gets' is deprecated [-Wdeprecated-declarations]
  gets(s1);
  ^~~~
In file included from /in/foo.c:1:0:
/usr/include/stdio.h:640:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^~~~
/in/foo.c:9:2: warning: 'gets' is deprecated [-Wdeprecated-declarations]
  gets(s2);
  ^~~~
In file included from /in/foo.c:1:0:
/usr/include/stdio.h:640:14: note: declared here
 extern char *gets (char *__s) __wur __attribute_deprecated__;
              ^~~~
/in/foo.c:7:8: warning: unused variable 'j' [-Wunused-variable]
  int i,j;
        ^
/in/foo.c:7:6: warning: unused variable 'i' [-Wunused-variable]
  int i,j;
      ^
/in/foo.c: In function 'change':
/in/foo.c:24:2: warning: implicit declaration of function 'strcpy' [-Wimplicit-function-declaration]
  strcpy(*b1,*b);
  ^~~~~~
/in/foo.c:24:2: warning: incompatible implicit declaration of built-in function 'strcpy'
/in/foo.c:24:2: note: include '<string.h>' or provide a declaration of 'strcpy'
/in/foo.c:24:9: warning: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion]
  strcpy(*b1,*b);
         ^
/in/foo.c:24:9: note: expected 'char *' but argument is of type 'char'
/in/foo.c:24:13: warning: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion]
  strcpy(*b1,*b);
             ^
/in/foo.c:24:13: note: expected 'const char *' but argument is of type 'char'
/in/foo.c:25:2: error: 'len1' undeclared (first use in this function)
  len1=strlen(*a);
  ^~~~
/in/foo.c:25:2: note: each undeclared identifier is reported only once for each function it appears in
/in/foo.c:25:7: warning: implicit declaration of function 'strlen' [-Wimplicit-function-declaration]
  len1=strlen(*a);
       ^~~~~~
/in/foo.c:25:7: warning: incompatible implicit declaration of built-in function 'strlen'
/in/foo.c:25:7: note: include '<string.h>' or provide a declaration of 'strlen'
/in/foo.c:25:14: warning: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
  len1=strlen(*a);
              ^
/in/foo.c:25:14: note: expected 'const char *' but argument is of type 'char'
/in/foo.c:26:2: error: 'len2' undeclared (first use in this function)
  len2=strlen(*b);
  ^~~~
/in/foo.c:26:14: warning: passing argument 1 of 'strlen' makes pointer from integer without a cast [-Wint-conversion]
  len2=strlen(*b);
              ^
/in/foo.c:26:14: note: expected 'const char *' but argument is of type 'char'
/in/foo.c:27:6: error: 'i' undeclared (first use in this function)
  for(i=0;i<len2;i++)
      ^
/in/foo.c:28:7: error: 'j' undeclared (first use in this function)
   for(j=len2-i;j<0;j--)  *b[i]=*b1[j];  //perversion b
       ^
/in/foo.c:31:3: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   for(i=0;*a='\0';i++)
   ^~~
/in/foo.c:33:4: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
    for(j=0;*b='\0';j++)
    ^~~
/in/foo.c:40:2: error: expected '}' before 'else'
  else
  ^~~~
/in/foo.c:42:3: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
   for(i=0;*b='\0';i++)
   ^~~
/in/foo.c:44:4: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
    for(j=0;*a='\0';j++)
    ^~~
/in/foo.c:50:2: error: expected declaration or statement at end of input
  }
  ^
/in/foo.c:50:2: error: expected declaration or statement at end of input
/in/foo.c:22:6: warning: unused variable 'len' [-Wunused-variable]
  int len;
      ^~~

信息

递交者
类型
递交
题目
1-2 编程题
语言
C
递交时间
2019-09-21 14:58:12
评测时间
2019-09-21 14:58:12
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes