What are the different ways to input a string in C++? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

What are the different ways to input a string in C++?

How many ways are there..!! I only know by Cin '

17th Jun 2019, 8:17 AM
Amit Prasad
Amit Prasad - avatar
2 Answers
+ 8
fgets, getline, scanf("%s",), fscanf
17th Jun 2019, 9:28 AM
blACk sh4d0w
blACk sh4d0w - avatar
+ 3
You can use cin, cin.get, cin.getline, gets to input a string. Check out documentation in other sites to clearly understand how to use each of them.✌🏼
17th Jun 2019, 9:24 AM
thiru mal
thiru mal - avatar