using namespace std;
int main(){
const char* name = "common.dat";
ifstream ifs( name, ifstream::binary );
ifs.seekg( 0, fstream::end );
unsigned end = ifs.tellg();
ifs.clear();
ifs.seekg( 0, fstream::beg );
unsigned beg = ifs.tellg();
unsigned size = end - beg;
char* buf = new char[ size ];
memset( buf, 0, size );
ifs.read( buf, size );
cout << buf;
delete[] buf;
while(1){
;
}
return 0;
}
(しかも外したとて、ファイル中に改行がないと同じようにゴミがつきます。まあ今回は無視して大丈夫ですが・・・)
どうすればこのゴミを消せるのかお教え願います。