C++相談室 part43
■ このスレッドは過去ログ倉庫に格納されています
0368デフォルトの名無しさん
2005/09/05(月) 17:23:26stringstreamのポインタ操作が機能しません。
具体的には下記のコードでp0とp1が共に0を返し
seekpが機能しません。
結果"abcdefgh"と出力されます。
strstreamの場合正常に機能します。
なぜでしょうか?
std::stringstream stream( std::ios::out );
const std::ios::pos_type p0 = stream.tellp();
stream << "abcde";
const std::ios::pos_type p1 = stream.tellp();
stream.seekp( -3, std::ios::cur );
stream << "fgh" << std::endl;
■ このスレッドは過去ログ倉庫に格納されています