每次我尝试这个:
long crypt(int *integer)
{
printf("Enter five digit integer:\n");
scanf("%i",integer);
int digit1=integer/10000;
int digit2=(integer%10000)/1000;
int digit3=(integer%1000)/100;
int digit4=(integer%100)/10;
int digit5=(integer%10)/1;
const char *digit1c[10];
const char *digit2c[10];
const char *digit3c[10];
const char *digit4c[10];
const char *digit5c[10];
/...
}
(还有更多,但这似乎是问题所在,我将根据要求添加其余部分。)
然后它返回此错误:
math2.h:44:20: error: invalid operands to binary / (have ‘int *’ and ‘int’)
math2.h:45:21: error: invalid operands to binary % (have ‘int *’ and ‘int’)
math2.h:46:21: error: invalid operands to binary % (have ‘int *’ and ‘int’)
math2.h:47:21: error: invalid operands to binary % (have ‘int *’ and ‘int’)
math2.h:48:21: error: invalid operands to binary % (have ‘int *’ and ‘int’)
我知道这与我用来初始化数字的运算符有关,我确实尝试将它们的类型更改为int *
但没有奏效。那么这里到底发生了什么?