I’m attempting to read data from a text file in the format:
Plain Egg1.45Bacon and Egg2.45Muffin0.99French Toast1.99Fruit Basket2.49Cereal0.69Coffee0.50Tea0.75
etc….
I’m doing this by attempting to read the data into an arraymenuList[] of type menuItemType, within my function getData, usinga while loop with either ‘eof()’, ‘ifstream’, or ‘ifstream >>variable’ as parameters. The issue is that the while loop stopsafter the first iteration…Source Code:
#include <iostream>#include <iomanip>#include <string>#include <cmath>#include <fstream>using namespace std;//Structure Definitionsstruct menuItemType{ string menuItem; // menu item name double menuPrice; // menu item price};//Function prototypevoid getData(menuItemType menuList[], ifstream&);void showMenu(menuItemType menuList[]);//Global Variables//Main Functionint main() { //Declarations
PayPal Gateway not configured
PayPal Gateway not configured