VS2010,代碼如下:
#include<fstream>
using namespace std;
int main(void)
{
ofstream op("file_create.txt");
ifstream in;
op<<"我的錯"<<endl;
in.open("file_create.txt",ios::_Nocreate);
if(in.fail())
cout<<"打開失敗"<<endl;
else
cout<<"打開成功"<<endl;
in.close();
}
試過std::cout沒用
加<iostream>好像有用
????
好奇怪啊
uj5u.com熱心網友回復:
#include <iostream>轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/111491.html
標籤:基礎類
上一篇:這個是怎么設計實作的?
下一篇:ExpertsClient.exe 中的 0x04c69212 處有未經處理的例外: 0xC0000005: 讀取位置 0xbaadf00d 時發生訪問沖突
