reading a file data into an array of a struct

Hello! I kinda need help on how to read a file data into an array of a struct type. I did google guides but i still cant figure it out.
I will show what i have so far but is wrong. This is is the menu for clarification. Any help is appreciated



Plain Egg $1.45
Bacon and Egg $2.45
Muffin $0.99
French Toast $1.99
Fruit Basket $2.49
Cereal $0.69
Coffee $0.50
Tea $0.75

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
struct menuItemType
{
	string menuItem;
	double menuPrice;
	int Count;
};

void getData(menuItemType menuList[])
{
	ifstream inFile;
	string breakfast[] = {0};
	inFile.open("menu.txt");

	while (!inFile.eof())
	{
		inFile >> breakfast.menuList
		
	}

}
Last edited on
May want to look at the code I posted here - http://www.cplusplus.com/forum/beginner/148719/#msg778977
Topic archived. No new replies allowed.