+ 1

how to get input string ?

which type? which library?

29th Sep 2016, 2:13 PM
Md Shoriful Islam
Md Shoriful Islam - avatar
2 Answers
+ 2
if you need a program to take an input of type string, you need to include the string library: #include<string> then you declare a variable of type string: string NameOfYourChoice; and finally, get it from the standard input.: std::cin>> NameOfYourChoice; Now, there are other ways of accepting a string input, but this is the most basic one that should be good enough for basic programs.
29th Sep 2016, 7:17 PM
Petr Dron
Petr Dron - avatar
0
thanks
30th Sep 2016, 6:00 AM
Md Shoriful Islam
Md Shoriful Islam - avatar