c++ CStdioFile的使用

新建一对话框应用,在OnInitialDialog()里面添加下面代码 


	TCHAR* pFileName = _T("file.data");
	CStdioFile f1;
	if (!f1.Open(pFileName,CFile::modeCreate|CFile::modeWrite|CFile::typeText))
	{
		TRACE(_T("Unable to open file"));
	}
	f1.WriteString(_T("helloworld"));
	f1.Flush();
	f1.Close();

猜你喜欢

转载自blog.csdn.net/dxm809/article/details/114776356
今日推荐