/ Vijos /

记录详情

Compile Error

/in/foo.c: In function 'main':
/in/foo.c:25:17: warning: implicit declaration of function 'getch'; did you mean 'getc'? [-Wimplicit-function-declaration]
   a[i].grade1 = getch();
                 ^~~~~
                 getc
In file included from /usr/include/string.h:630:0,
                 from /in/foo.c:3:
/in/foo.c:42:34: warning: passing argument 1 of '__builtin_strlen' makes pointer from integer without a cast [-Wint-conversion]
   if (a[i].grade1 > 85 && strcmp(a[i].c1, "Y") == 0)
                                  ^
/in/foo.c:42:34: note: expected 'const char *' but argument is of type 'char'
/in/foo.c:42:34: warning: passing argument 1 of '__builtin_strcmp' makes pointer from integer without a cast [-Wint-conversion]
   if (a[i].grade1 > 85 && strcmp(a[i].c1, "Y") == 0)
                                  ^
/in/foo.c:42:34: note: expected 'const char *' but argument is of type 'char'
/in/foo.c:42:34: warning: passing argument 1 of '__builtin_strlen' makes pointer from integer without a cast [-Wint-conversion]
   if (a[i].grade1 > 85 && strcmp(a[i].c1, "Y") == 0)
                                  ^
/in/foo.c:42:34: note: expected 'const char *' but argument is of type 'char'
/in/foo.c:42:34: warning: passing argument 1 of '__builtin_strcmp' makes pointer from integer without a cast [-Wint-conversion]
   if (a[i].grade1 > 85 && strcmp(a[i].c1, "Y") == 0)
                                  ^
/in/foo.c:42:34: note: expected 'const char *' but argument is of type 'char'
/in/foo.c:42:34: warning: passing argument 1 of '__builtin_strcmp' makes pointer from integer without a cast [-Wint-conversion]
   if (a[i].grade1 > 85 && strcmp(a[i].c1, "Y") == 0)
                                  ^
/in/foo.c:42:34: note: expected 'const char *' but argument is of type 'char'
/in/foo.c:42:34: warning: passing argument 1 of '__builtin_strcmp' makes pointer from integer without a cast [-Wint-conversion]
   if (a[i].grade1 > 85 && strcmp(a[i].c1, "Y") == 0)
                                  ^
/in/foo.c:42:34: note: expected 'const char *' but argument is of type 'char'
/in/foo.c:46:34: warning: passing argument 1 of '__builtin_strlen' makes pointer from integer without a cast [-Wint-conversion]
   if (a[i].grade2 > 80 && strcmp(a[i].c2, "Y") == 0)
                                  ^
/in/foo.c:46:34: note: expected 'const char *' but argument is of type 'char'
/in/foo.c:46:34: warning: passing argument 1 of '__builtin_strcmp' makes pointer from integer without a cast [-Wint-conversion]
   if (a[i].grade2 > 80 && strcmp(a[i].c2, "Y") == 0)
                                  ^
/in/foo.c:46:34: note: expected 'const char *' but argument is of type 'char'
/in/foo.c:46:34: warning: passing argument 1 of '__builtin_strlen' makes pointer from integer without a cast [-Wint-conversion]
   if (a[i].grade2 > 80 && strcmp(a[i].c2, "Y") == 0)
                                  ^
/in/foo.c:46:34: note: expected 'const char *' but argument is of type 'char'
/in/foo.c:46:34: warning: passing argument 1 of '__builtin_strcmp' makes pointer from integer without a cast [-Wint-conversion]
   if (a[i].grade2 > 80 && strcmp(a[i].c2, "Y") == 0)
                                  ^
/in/foo.c:46:34: note: expected 'const char *' but argument is of type 'char'
/in/foo.c:46:34: warning: passing argument 1 of '__builtin_strcmp' makes pointer from integer without a cast [-Wint-conversion]
   if (a[i].grade2 > 80 && strcmp(a[i].c2, "Y") == 0)
                                  ^
/in/foo.c:46:34: note: expected 'const char *' but argument is of type 'char'
/in/foo.c:46:34: warning: passing argument 1 of '__builtin_strcmp' makes pointer from integer without a cast [-Wint-conversion]
   if (a[i].grade2 > 80 && strcmp(a[i].c2, "Y") == 0)
                                  ^
/in/foo.c:46:34: note: expected 'const char *' but argument is of type 'char'
/in/foo.c:56:9: warning: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion]
  strcpy(zuihou.c1, a[0].c1);
         ^~~~~~
In file included from /in/foo.c:3:0:
/usr/include/string.h:125:14: note: expected 'char * restrict' but argument is of type 'char'
 extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
              ^~~~~~
/in/foo.c:56:20: warning: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion]
  strcpy(zuihou.c1, a[0].c1);
                    ^
In file included from /in/foo.c:3:0:
/usr/include/string.h:125:14: note: expected 'const char * restrict' but argument is of type 'char'
 extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
              ^~~~~~
/in/foo.c:57:9: warning: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion]
  strcpy(zuihou.c2, a[0].c2);
         ^~~~~~
In file included from /in/foo.c:3:0:
/usr/include/string.h:125:14: note: expected 'char * restrict' but argument is of type 'char'
 extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
              ^~~~~~
/in/foo.c:57:20: warning: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion]
  strcpy(zuihou.c2, a[0].c2);
                    ^
In file included from /in/foo.c:3:0:
/usr/include/string.h:125:14: note: expected 'const char * restrict' but argument is of type 'char'
 extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
              ^~~~~~
/in/foo.c:68:11: warning: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion]
    strcpy(zuihou.c1, a[i].c1);
           ^~~~~~
In file included from /in/foo.c:3:0:
/usr/include/string.h:125:14: note: expected 'char * restrict' but argument is of type 'char'
 extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
              ^~~~~~
/in/foo.c:68:22: warning: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion]
    strcpy(zuihou.c1, a[i].c1);
                      ^
In file included from /in/foo.c:3:0:
/usr/include/string.h:125:14: note: expected 'const char * restrict' but argument is of type 'char'
 extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
              ^~~~~~
/in/foo.c:69:11: warning: passing argument 1 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion]
    strcpy(zuihou.c2, a[i].c2);
           ^~~~~~
In file included from /in/foo.c:3:0:
/usr/include/string.h:125:14: note: expected 'char * restrict' but argument is of type 'char'
 extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
              ^~~~~~
/in/foo.c:69:22: warning: passing argument 2 of 'strcpy' makes pointer from integer without a cast [-Wint-conversion]
    strcpy(zuihou.c2, a[i].c2);
                      ^
In file included from /in/foo.c:3:0:
/usr/include/string.h:125:14: note: expected 'const char * restrict' but argument is of type 'char'
 extern char *strcpy (char *__restrict __dest, const char *__restrict __src)
              ^~~~~~
/tmp/ccDtxsHq.o: In function `main':
foo.c:(.text.startup+0x7f): undefined reference to `getch'
foo.c:(.text.startup+0x89): undefined reference to `getch'
foo.c:(.text.startup+0x90): undefined reference to `getch'
foo.c:(.text.startup+0x99): undefined reference to `getch'
collect2: error: ld returned 1 exit status

信息

递交者
类型
递交
题目
P1001 谁拿了最多奖学金
语言
C
递交时间
2017-10-19 20:42:51
评测时间
2017-10-19 20:42:51
评测机
分数
0
总耗时
140ms
峰值内存
5.883 MiB