Sdílet prostřednictvím


string (<string>)

Typ, který popisuje specializace basic_string šablona třídy s prvky typu char jako řetězec.

typedef basic_string<char, char_traits<char>, allocator<char> > string;

Poznámky

Viz basic_string::basic_string seznam řetězec konstruktory.

Příklad

// string_string.cpp
// compile with: /EHsc
#include <string>
#include <iostream>

int main( ) 
{
   using namespace std;

   // Equivalent ways to declare an object 
   // of type basic_string <char>
   const basic_string <char> s1 ( "test" );
   string s2 ( "test" );   // Uses the typedef for string

   // comparison between two objects of type basic_string
   if ( s1 == s2 )
      cout << "The strings s1 & s2 are equal." << endl;
   else
      cout << "The strings s1 & s2are not equal." << endl;
}
  

Požadavky

Záhlaví: <string>

Obor názvů: std

Viz také

Referenční dokumentace

basic_string Class

basic_string::basic_string