私は現在、顧客の注文を含む割り当て用のプログラムをコーディングしています...これまでのところすべてが正しくコーディングされていますが、ユーザー入力の読み取りに関しては問題があります..ユーザーに時間を与えることなく2行が画面に表示されます.注文数量を入力してください。これは、scanf を使用しているためです。fflush(stdin) を使用して char() を取得しようとしましたが、何も機能しませんでした。
puts("\nEnter Product Details\n");
puts("Product Name: ");
gets(newProduct.Name);
puts("ISBN: ");
gets(newProduct.ISBN);
puts("Description: ");
gets(newProduct.Description);
puts("Price: ");
scanf("%f",&newProduct.Price);
puts("Quantity in Stock: ");
scanf("%d",&newProduct.QuantityinStock);
printf("Supplier: ");
gets(newProduct.Supplier);
printf("Order Quantity: ");
scanf("%d",&newProduct.OrderQuantity);