STL string library

What functions from the STL String library is used for what.....thanks
What do you mean? It's all for strings, of course.
Do you mean "what do the functions do?"
http://www.cplusplus.com/reference/string/string/?kw=string

Or do you mean "Are the string library functions used elsewhere in the STL?
string is not used outside the string header.
STL containers are templates which can be specialized for strings.
i.e. set<string>


well Im working with strings, pointers, and arrays, and wondered which STL string library is used for returning the length of a string....thanks
@willynilly

Note: You aren't asking for a library, you're asking for a function. when you declar a string, you're actually declaring a new instance of a class called string. The class has member functions, one of which does what you're asking us for.

Classes may be a bit too much for you right now if you're too new. I remember how complicated they were to me.

You can get the size of any string by calling the size() member function of the string class.

psuedo code:

1
2
3
4
5
6
7
8
string my_string = "Hello!";

/* my_string.size() returns the number of characters in the string,
effectively giving you the length of the string.  This also implies that
if (my_string.size() == 0) the string represents nothing.*/

cout<< my_string.size()<< endl;
//the size of the string should be 6. 


Hope this helps!
THANK YOU VERY MUCH
Topic archived. No new replies allowed.