Fir what do u use "string" headerfile? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Fir what do u use "string" headerfile?

29th Jul 2017, 4:01 AM
Swaroop M
Swaroop M - avatar
2 Answers
+ 7
<string> includes the string class, which is used for manipulation of string objects. http://en.cppreference.com/w/cpp/header/string Some compilers automatically add the <string> header for you, when you use a string variable. However, it is better to explicitly include the header if you will be using strings. VS2017, for example does not overload << for string variables in the output stream if <string> is not included.
29th Jul 2017, 4:13 AM
Hatsy Rei
Hatsy Rei - avatar
+ 5
strings.. i.e string someText { "This is a string" };
29th Jul 2017, 4:06 AM
jay
jay - avatar