W
wobudui
Hi everyboday, I have some trouble in dealing with the file stream.
My souce code Listed hear:
int main()
{
char buffer[10]={0};
ofstream ofile.open("mydata.in",ios::app);
ofile.seekp(10);
ofile.write(buffer,sizeof(buffer));
ofile.close();
}
My purpose is to write 10 zeros in the file start at position 10. Of
course ,
mydata.in is a file which size is more than 10 charecters.But the it
seem that the seekp don't work.
All comments will be welcomed. Thanks.
My souce code Listed hear:
int main()
{
char buffer[10]={0};
ofstream ofile.open("mydata.in",ios::app);
ofile.seekp(10);
ofile.write(buffer,sizeof(buffer));
ofile.close();
}
My purpose is to write 10 zeros in the file start at position 10. Of
course ,
mydata.in is a file which size is more than 10 charecters.But the it
seem that the seekp don't work.
All comments will be welcomed. Thanks.