共用方式為


operator<< (<string>)

將字串寫入至輸出資料流的樣板函式。

template<class CharType, class Traits, class Allocator> 
   basic_ostream<CharType, Traits>& operator<<( 
      basic_ostream<CharType, Traits>& _Ostr, 
      const basic_string<CharType, Traits, Allocator>& _Str 
);

參數

  • _Ostr
    寫入的輸出資料流。

  • _Str
    要編碼的字串寫入輸出資料流。

傳回值

要寫入輸出資料流的 _Ostr寫入指定的字串值。

備註

插入範本類別物件 _Str 的樣板函式多載運算子<< basic_string 輸入資料流 _Ostr*。*函式有效地傳回 _Ostr。write(_Str。c_str, _Str。大小)。

需求

標頭:<string>

命名空間: std

請參閱

參考

string::operator<<