C++ I have code for a inventory.dat file we are supposed to pullfrom. I re-read the directions and discovered we are not supposedto be using arrays. Any suggestions? Here is my code.
#include <iostream>
#include <fstream>
#include <string>
#include <stdlib.h>
using namespace std;
const int DESC_SIZE = 40;
struct Product
{
long prodNum;
char prodName[DESC_SIZE];
double price;
int qty;
};
//function prototypes
int showMenu();
void printFile(fstream&);
void displayRecord(fstream&);
void modifyRecord(fstream&);
//main function
int main()
{
long choice;
//declare a fstream file object
fstream inventory;
do
{
choice = showMenu();
switch (choice)
{
case 1: //Display product inventory file
printFile(inventory);
break;
case 2: //Display a particular product
displayRecord(inventory);
break;
case 3: //Modify a product
modifyRecord(inventory);
break;
default: //Invalid selection
cout << “Invalid selection.” << endl;
}
}while (choice != 4);
cout << “Thank you. Good bye.” << endl;
inventory.close();
system(“pause”);
return 0;
}
// function that prompts user to
PayPal Gateway not configured
PayPal Gateway not configured