|
等 级:长老 |
经 验 值:3268 |
魅 力 值:341 |
龙 币:1692 |
积 分:1985.3 |
注册日期:2003-03-23 |
|
|
|
faint, 原想改个颜色,把程序改乱了。再贴一遍。
#include "stdafx.h"
#include <stdio.h>
#include <afx.h>
int main(int argc, char* argv[])
{
char sDmaPackage[200];
FILE *fp;
CFile filetest;
CFileException fe;
char *pFileName="d:\\test.txt";
if(!filetest.Open(pFileName,CFile::modeRead,&fe))
{
// fe.ReportError();
fp=fopen(pFileName,"wb");
fwrite(&sDmaPackage,sizeof(sDmaPackage),1,fp);
fclose(fp);
}
else
{
filetest.Close();
fp=fopen(pFileName,"rb");
fread(&sDmaPackage,sizeof(sDmaPackage),1,fp);
fclose(fp);
}
return 0;
}
|
|
|
|