看了MSDN,我已经知道了CFile::Open和CFile::Read 以及write函数的用法,语句也没错,为什么老是编译不过#include "stdafx.h"
#include "stdio.h"
int main()
{
char *pszFileName="c:\\test\\myfile.txt";
CFile myfile;
CFileException fileException;
myfile.Open(pszFileName,CFile::modeCreate|CFile::modeReadWrite,&fileException);
//return 0;
}
报错:说是不能打开预编译头文件
我一直对VC++的编程环境不是很清楚,请问要怎么操作才能成功呢?最好是从VC++的操作上给解释一下
#include "stdio.h"
int main()
{
char *pszFileName="c:\\test\\myfile.txt";
CFile myfile;
CFileException fileException;
myfile.Open(pszFileName,CFile::modeCreate|CFile::modeReadWrite,&fileException);
//return 0;
}
报错:说是不能打开预编译头文件
我一直对VC++的编程环境不是很清楚,请问要怎么操作才能成功呢?最好是从VC++的操作上给解释一下
if (file.Open(strPath, CFile::modeCreate + CFile::modeWrite))
{
file.Write((LPCSTR)strFileContent, strFileContent.GetLength());
file.Close();
return TRUE;
}
#include <stdio.h>
m_file = fopen("filename", "rb+w");
if(m_file == NULL) return;
fseek(m_file, 0L, SEEK_SET);
char *buffer = "adsfadafdsfad";
fwrite(buffer, strlen(buffer), 1, m_file);