short int cipher[50],len;
while(cipher != 0)
{
cipher=cipher/10;
++len;
}
需要计算用户提供的位数。
error: invalid operands to binary / (have ‘short int *’ and ‘int’)
cipher=cipher/10;
正如gsamaras所说,你将cipher
定义为50个short int
s的数组。大概你只需要一个数字,所以你要定义它。 G。作为long long cipher;
(C不是COBOL或必须指定位数的东西)。并且不要忘记初始化len
。