Compile Error

foo.c: In function 'main':
foo.c:18:2: error: unknown type name 'BigInt'; use 'struct' keyword to refer to the type
  BigInt x1;
  ^~~~~~
  struct 
foo.c:19:4: error: request for member 'n' in something not a structure or union
  x1.n = 1; x1.digit[0] = 1;   // 初始化为1
    ^
foo.c:19:14: error: request for member 'digit' in something not a structure or union
  x1.n = 1; x1.digit[0] = 1;   // 初始化为1
              ^
foo.c:20:31: warning: passing argument 1 of 'Mul' from incompatible pointer type [-Wincompatible-pointer-types]
  for (i = 1; i <= m; i++) Mul(&x1, a);
                               ^
foo.c:9:6: note: expected 'struct BigInt *' but argument is of type 'int *'
 void Mul(struct BigInt* p, int x);
      ^~~
foo.c:22:2: error: unknown type name 'BigInt'; use 'struct' keyword to refer to the type
  BigInt x2;
  ^~~~~~
  struct 
foo.c:23:4: error: request for member 'n' in something not a structure or union
  x2.n = 1; x2.digit[0] = 1;   // 初始化为1
    ^
foo.c:23:14: error: request for member 'digit' in something not a structure or union
  x2.n = 1; x2.digit[0] = 1;   // 初始化为1
              ^
foo.c:24:31: warning: passing argument 1 of 'Mul' from incompatible pointer type [-Wincompatible-pointer-types]
  for (i = 1; i <= n; i++) Mul(&x2, b);
                               ^
foo.c:9:6: note: expected 'struct BigInt *' but argument is of type 'int *'
 void Mul(struct BigInt* p, int x);
      ^~~
foo.c:26:2: error: unknown type name 'BigInt'; use 'struct' keyword to refer to the type
  BigInt x3;
  ^~~~~~
  struct 
foo.c:27:6: warning: passing argument 1 of 'Add' from incompatible pointer type [-Wincompatible-pointer-types]
  Add(&x1, &x2, &x3);
      ^
foo.c:11:6: note: expected 'struct BigInt *' but argument is of type 'int *'
 void Add(struct BigInt* p1, struct BigInt* p2, struct BigInt* pAns);
      ^~~
foo.c:27:11: warning: passing argument 2 of 'Add' from incompatible pointer type [-Wincompatible-pointer-types]
  Add(&x1, &x2, &x3);
           ^
foo.c:11:6: note: expected 'struct BigInt *' but argument is of type 'int *'
 void Add(struct BigInt* p1, struct BigInt* p2, struct BigInt* pAns);
      ^~~
foo.c:27:16: warning: passing argument 3 of 'Add' from incompatible pointer type [-Wincompatible-pointer-types]
  Add(&x1, &x2, &x3);
                ^
foo.c:11:6: note: expected 'struct BigInt *' but argument is of type 'int *'
 void Add(struct BigInt* p1, struct BigInt* p2, struct BigInt* pAns);
      ^~~
foo.c:28:9: warning: passing argument 1 of 'Output' from incompatible pointer type [-Wincompatible-pointer-types]
  Output(&x3);
         ^
foo.c:8:6: note: expected 'struct BigInt *' but argument is of type 'int *'
 void Output(struct BigInt* p);
      ^~~~~~
foo.c:16:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d", &a, &m);
  ^~~~~~~~~~~~~~~~~~~~~
foo.c:17:2: warning: ignoring return value of 'scanf', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d", &b, &n);
  ^~~~~~~~~~~~~~~~~~~~~
[Hydro](https://hydro.ac)提供评测服务

信息

递交者
类型
递交
题目
P1073 A11-3 高精度整数的加法
语言
C
递交时间
2021-11-14 21:34:20
评测时间
2021-11-14 21:34:20
评测机
分数
0
总耗时
0ms
峰值内存
0 Bytes