0

What should I put when the error is "expected primary-experession"??

C++, array struct

13th Jul 2019, 6:34 PM
Kuro Himitsu
Kuro Himitsu - avatar
2 Respuestas
+ 1
#include <iostream> using namespace std; struct customerDetai { string name; string address; string date; float time; int quantity; float price; }C[5]; int main() { int a, i; int mMN; cout << "\n>Customer Detail<"; cout << "\nEnter num customer: "; (cin >>i).get(); for(a=0; a<i; a++){ cout << "\nCustomer Name"; getline (cin,C[a].name); cout << "Customer Address"; getline (cin,C[a].address); cout << "Date of Deliver"; (cin >> C[a].date).get(); cout << "Time of Deliver"; (cin >> C[a].time).get(); cout << "Quantity of Order"; (cin >> C[a].quantity).get(); cout << "Total Price"; (cin >> C[a].price).get();} cout << endl; DD: for(a=0; a<10; a++){ delete C[a];} delete []C; return 0; }
13th Jul 2019, 7:07 PM
Kuro Himitsu
Kuro Himitsu - avatar
0
Ooo..so how to delete the array??
13th Jul 2019, 7:57 PM
Kuro Himitsu
Kuro Himitsu - avatar