How to get multiple string input in c++? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

How to get multiple string input in c++?

When I use 2 or more string variables and get input from user using for loop first time it receive input in all strings and then it skips input for first variable and show the option for next variables

22nd Dec 2022, 4:33 PM
Malik Faheem
Malik Faheem - avatar
2 Answers
+ 5
To get multiple string inputs from the user you can use a loop and the getline function to read each string. https://code.sololearn.com/cCdpz34dW0tS/?ref=app
22nd Dec 2022, 5:28 PM
Sadaam Linux
Sadaam Linux - avatar
+ 1
Please attach your code bit link in post Description. It is necessary to read it first to know what's wrong and/or how to fix it https://www.sololearn.com/post/75089/?ref=app
22nd Dec 2022, 4:45 PM
Ipang