C语言系统文件操作
FILE *pFile=fopen("1.txt","w");
fwrite("http://www.sunxin.org",1,strlen("http://www.sunxin.org"),pFile);
fseek(pFile,10,SEEK_SET); //文件指针定位
fwrite("ftp:",1,strlen("ftp:"),pFile);
fwrite("http://www.sunxin.org",1,strlen("http://www.sunxin.org"),pFile);
fflush(pFile);
//C语言系统文件操作采用缓冲区技术,若缓冲区未满,数据不马上写进文件中,若需要马上写进文件中去,需要调用fflush()
fclose(pFile);
还有相关函数: ftell() 、rewind(......
阅读全文