#include <iostream.h>
#include <cstdlib>
#include <fstream>
#include <stdio.h>
using namespace std;
int main(int argc, char *argv[])
{
char* str = "e:/test/nihao.txt";
FILE *t = fopen(str,"wb+");
char tbuf[10]={0};
fwrite(tbuf,1,100,t);
fclose(t);
system("PAUSE");
return EXIT_SUCCESS;
}
FILE *tIn = fopen(szStr,"rb");
if (tIn == NULL) {
cout<<"文件不能打开!";
return NULL;
}
fseek(tIn, 0, SEEK_END);
int tSize = ftell(tIn);
fseek(tIn, 0, SEEK_SET);
char *tBuf = new char[tSize];
fread(tBuf,tSize,1,tIn);
fclose(tIn);
</script>