のscanfが動作していない私は、Cのコードの次の行を使用する場合、正常に動作しイマイチ:変換指定子を間違って使用していますか? scanf())(Cで
double withdraw = 0;
scanf("%.2lf",&withdraw);
printf("\n\nWithdraw %.2lf?",&withdraw);
これ:
double withdraw = 0;
scanf("%.2lf",withdraw);
printf("\n\nWithdraw %.2lf?",withdraw);
これ:
double withdraw = 0;
scanf("%.2lf",&withdraw);
printf("\n\nWithdraw %.2lf?",withdraw);
、最終的には、この:
double withdraw = 0;
scanf("%.2lf",withdraw);
printf("\n\nWithdraw %.2lf?",&withdraw);
scanf関数へ
入力()は常にこれです:撤退の
1
出力は常にこれです:
0.00
助けてください。これは私にとってとても狂っているようだ!
'printfの( "\ nは\ nWithdraw%.2lf?"、&撤退);' - > 'のprintf( "?\ N \ nWithdraw%.2lf"、撤退);' ... '削除& '印刷の呼び出しで。 –
投稿されたコードブロックの4つのバージョンすべてを試しました。 – TeddyBearWithACape
コードの3番目のバリエーションが要件を満たしていて、依然として0.00 – TeddyBearWithACape