+ 1
Having trouble with c++ for loops/getline
4 Respuestas
+ 1
task i created:
get amount of people going to party
for every person going give prompt for their name
output their name and say they have been invited.
use for loop
problem:
it doesn’t prompt the user for the first person, yet outputs that blank has been invited
i think its a problem with the getline function
0
what trouble are you having?
seems to work
0
no, it's not. it's just because of solo learn asking for all input at once. it's working as expected for me.
0
and the last line that only prints an "a" happens because your loop is executed until x<party+1, which doesn't really make sense. remove the +1 if you mean that line.
if you mean the completely empty line before the others, that's because of sololearn as I described above.