#I'm new to coding and learning C++ and I'm having an issue with this assignment

8 messages · Page 1 of 1 (latest)

dusk turtle
weak horizonBOT
#

When your question is answered use !solved to mark the question as resolved.

Remember to ask specific questions, provide necessary details, and reduce your question to its simplest form. For tips on how to ask a good question use !howto ask.

solar knoll
#

Look carefully at your count variable

#

What do you think its value is when you do count++?

#

There are other problems with your code but just focus on this first since it can lead to Undefined Behavior or UB for short

dusk turtle
#

i just defined the count variable as 0 and got rid of the getline(cin, ingrident) and replaced it with cin >> ingridient and it worked thanks

#

!solved

weak horizonBOT
#

Thank you and let us know if you have any more questions!

This thread is now set to auto-hide after an hour of inactivity