GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • cpprefjp - C++日本語リファレンス
  • GitHub Project

This view

  • Original page
  • New address

GeezerVison is showing cpprefjp.github.io — std::basic_stringstream::rdbuf - cpprefjp C++日本語リファレンス

  1. リファレンス
  2. sstream
  3. basic_stringstream
  4. rdbuf

最終更新日時: 2025年10月21日 15時28分50秒 (JST)
Raclamusi が更新

履歴 編集

function
<sstream>

std::basic_stringstream::rdbuf

basic_stringbuf<CharT, Traits, Allocator>* rdbuf() const;

概要

ストリームバッファオブジェクトを取得する。

戻り値

内部のbasic_stringbufオブジェクトへのポインタ。

例

#include <iostream>
#include <sstream>

int main()
{
  std::stringstream ss("test");

  std::streambuf* buf = ss.rdbuf();

  // バッファから文字を読み取り
  std::cout << static_cast<char>(buf->sbumpc()) << std::endl; // 't'

  // バッファに文字を書き込み
  buf->sputc('!');

  std::cout << ss.str() << std::endl;
}

出力

t
!est

You are visitor 01402520 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.