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;发布于 2019-01-23 17:50:34
正如gsamaras所提到的,你将cipher定义为一个由50个short int组成的数组,假设你只想要一个数字,所以你可以将它定义为例如long long cipher; (C不是COBOL语言或者其他必须指定位数的语言)。别忘了初始化len。
https://stackoverflow.com/questions/54324169
复制相似问题