getting string from file c++ code example

Example: reading in two strings from a text file c++

Plain Egg
1.45

Bacon and Egg
2.45

Muffin
0.99

French Toast
1.99

Fruit Basket
2.49

Cereal
0.69

Lemon Tea
0.75

Cheeseburger
2.25

menu[0].MenuItem  = Plain Egg
menu[0].MenuPrice = 1.45

menu[1].MenuItem  = Bacon and Egg
menu[1].MenuPrice = 2.45

menu[2].MenuItem  = Muffin
menu[2].MenuPrice = 0.99

menu[3].MenuItem  = French Toast
menu[3].MenuPrice = 1.99

menu[4].MenuItem  = Fruit Basket
menu[4].MenuPrice = 2.49

menu[5].MenuItem  = Cereal
menu[5].MenuPrice = 0.69

menu[6].MenuItem  = Lemon Tea
menu[6].MenuPrice = 0.75

menu[7].MenuItem  = Cheeseburger
menu[7].MenuPrice = 2.25

Tags:

Cpp Example