记录详情

Compile Error

/in/foo.c:6:10: error: unknown type name 'Date'
 int days(Date d1, Date d2)
          ^~~~
/in/foo.c:6:19: error: unknown type name 'Date'
 int days(Date d1, Date d2)
                   ^~~~
/in/foo.c: In function 'main':
/in/foo.c:26:2: error: unknown type name 'Date'
  Date d1,d2;
  ^~~~
/in/foo.c:26:2: note: use 'struct' keyword to refer to the type
/in/foo.c:27:23: error: request for member 'y' in something not a structure or union
  scanf("%d-%d-%d", &d1.y, &d1.m, &d1.d);
                       ^
/in/foo.c:27:30: error: request for member 'm' in something not a structure or union
  scanf("%d-%d-%d", &d1.y, &d1.m, &d1.d);
                              ^
/in/foo.c:27:37: error: request for member 'd' in something not a structure or union
  scanf("%d-%d-%d", &d1.y, &d1.m, &d1.d);
                                     ^
/in/foo.c:28:23: error: request for member 'y' in something not a structure or union
  scanf("%d-%d-%d", &d2.y, &d2.m, &d2.d);
                       ^
/in/foo.c:28:30: error: request for member 'm' in something not a structure or union
  scanf("%d-%d-%d", &d2.y, &d2.m, &d2.d);
                              ^
/in/foo.c:28:37: error: request for member 'd' in something not a structure or union
  scanf("%d-%d-%d", &d2.y, &d2.m, &d2.d);
                                     ^
/in/foo.c:29:21: warning: implicit declaration of function 'days' [-Wimplicit-function-declaration]
  printf("%ddays\n", days(d1,d2));
                     ^~~~

信息

递交者
类型
递交
题目
15-1 改错题
语言
C
递交时间
2019-02-14 15:26:55
评测时间
2019-02-14 15:26:55
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes