次の方法で共有


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
    The string 出力ストリームに入力します。

戻り値

出力ストリーム _Ostrに指定された文字列値を書き込みます。

解説

そのテンプレート関数は operator<< をオーバーロードしてテンプレート クラス basic_string のオブジェクト _Str をストリーム *Ostr. に挿入します。*関数は、に _Ostr を返します。write (_Str。c_strの _Str。サイズ)。

必要条件

ヘッダー: <string>

名前空間: std

参照

関連項目

string::operator<<