2013-03-02から1日間の記事一覧

seekg tellg が無効な値を返す

c++

ifstream is ("msg.bin", ios::in | ios::binary); if (is.fail()) assert (!"miss"); // ファイルサイズを調べる is.seekg (0, fstream::end); fstream::streampos end = is.tellg(); is.seekg (0, fstream::beg); ios::pos_type end = file->stream_->tell…