1
これは私のコード全体ではありませんが、このエラーが発生します。バイナリ式のオペランドが無効です。バイナリ式のオペランドが無効です( 'double'と 'double')
printf("How much change is owed?\n");
float change= GetFloat();
float roundf(float change);
change*=100;
int rem;
while (change>0)
{
if(change>=0.25)
rem=change % 0.25; > error, saying that this is a double????
}
printf ("%d\n", rem); I need the modulo , it is not working
return 0;
代わりにfmod(a、b)を使用してください。 – dasblinkenlight
100を掛けて丸めた後、整数の数学と整数変数を使って残りのプログラムを書くことができるはずです。 – user3386109
もし 'change> 0.0'なら' while(変更> 0) { if(変更> = 0.25) rem = whatever; } 'は無限ループのように見えます。 – chux