50)二进制文件I/O,e.g:
ifstream inFile;
ofstream outFile;
outFile.open( "c:\\1.dat", ios::binary);
for ( i = 0; i< 10; i++)
{
outFile.write( (char*)&a[i], sizeof( a[i] ) ); //强制转换
}
outFile.close();
inFile.open( "c:\\1.dat", ios::binary);
for ( i = 0; i< 10; i++)
{
inFile.read( (char*)&b[i], sizeof( b[i] ) );
}
inFile.close();
51)outFile.open ( "...", ios::binary | ios::app);
52)输入文件流对象.seekg(位移量, 起始点);
ios::beg ios::cur ios::end
53)seekp写指针的定位,类似于seekg
To be continued...