共用方式為


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;
}
  
  

需求

標題: <string>

命名空間: std

請參閱

參考

basic_string Class