basic_string::value_type

表示存储在字符串中的字符类型的类型。

typedef typename allocator_type::value_type value_type;

备注

它等效于 traits_type::char_type 等效并与类型 字符串对象的 char 等效。

示例

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

int main( ) 
{
   using namespace std;

   basic_string<char>::value_type ch1 = 'G';

   char ch2 = 'H';

   cout << "The character ch1 is: " << ch1 << "." << endl;
   cout << "The character ch2 is: " << ch2 << "." << endl;
}
  

要求

标头:< 字符串>

命名空间: std

请参见

参考

basic_string 类