How do I read user input line by line and store that user input into an array?
In other words, storing "Apples raw, 110, 50.6, 1.2, 1.0" into a char array and that whole line is index 0. Then index 1 will be "Bananas,225, etc"
Here is the user input:
Apples raw, 110, 50.6, 1.2, 1.0
Bananas, 225, 186, 6.2, 8.2
Bread pita whole wheat, 64, 134, 14, 22.6
Broccoli raw, 91, 21.9, 2.8, 6.3
Carrots raw, 128, 46.6, 2.6, 3.3
std::vectorinstead ofnew[]? It's usually a far better plan.istream& operator>>(istream& stream, NutritionData & data)Microsoft has an example here: https://learn.microsoft.com/en-us/cpp/standard-library/overloading-the-input-operator-for-your-own-classes?view=msvc-160