Standard C++ Library Class Reference
operator<= (const charT* lhs, const basic_string& rhs);
template<class charT, class traits, class Allocator>
bool
operator<= (const basic_string& lhs, const charT* rhs);
Returns a boolean value representing the lexigraphical less-than-or-equal relationship of lhs and rhs. Less-than-or-equal
is defined by the compare() member function. These functions return, respectively:
basic_string(lhs) <= rhs
lhs <= basic_string(rhs)
template<class charT, class traits, class Allocator>
bool
operator>= (const basic_string& lhs, const basic_string& rhs);
Returns a boolean value representing the lexigraphical greater-than-or-equal relationship of lhs and rhs.
Greater-than-or-equal is defined by the compare() member function.
template<class charT, class traits, class Allocator>
bool
operator>= (const charT* lhs, const basic_string& rhs);
template<class charT, class traits, class Allocator>
bool
operator>= (const basic_string& lhs, const charT* rhs);
Returns a boolean value representing the lexigraphical greater-than-or-equal relationship of lhs and rhs.
Greater-than-or-equal is defined by the compare() member. The functions return, respectively:
basic_string(lhs) >= rhs
lhs >= basic_string(rhs)
template<class charT, class traits, class Allocator>
istream&
operator>> (istream& is, basic_string& str);
Reads str from is using traits::char_in until a traits::is_del() element is read. All elements read, except the delimiter, are
placed in str. After the read, the function returns is.
template<class charT, class traits, class Allocator>
ostream&
operator<< (ostream& os, const basic_string& str);
Writes all elements of str to os in order from first to last, using traits::char_out(). After the write, the function returns os.
Non-member Function
template <class Stream, class charT, class traits,
class Allocator>
Stream&
getline (Stream& is, basic_string& str, charT delim);
An unformatted input function that extracts characters from is into str until npos - 1 characters are read, the end of the
input sequence is reached, or the character read is delim. The characters are read using traits::char_in().
Example
//
// string.cpp
//
#include<string>
#include <iostream.h>
int main()
{
string test;
//Type in a string over five characters long