#include #include #include #include using namespace std; struct
Product { int id; char name[30]; int quantity; float price; }; void
addProduct() { Product p; ofstream fout("inventory.txt", ios::app
| ios::binary); cout << "\nEnter Product ID: "; cin >> p.id; cout
<< "Enter Product Name: "; cin.ignore(); cin.getline(p.name, 30);
cout << "Enter Quantity: "; cin >> p.quantity; cout << "Enter
Price: "; cin >> p.price; fout.write((char*)&p;, sizeof(p));
fout.close(); cout << "\n■ Product Added Successfully!\n"; } //
Other functions: displayAll(), searchProduct(), updateProduct(),
deleteProduct()