#include<iostream>#include<fstream>using namespace std;int main(){ofstream file1; //建立輸出文件流對象 file1.open("c:\\1.txt");file1<< "豆豆" << endl; // 寫入內容 file1.close(); //關閉句柄 int result; char oldname[] ="1.txt";char newname[] ="d.txt";result=rename( "1.txt" , "d.txt" ); return 0; } 哪位可以告訴我,為什么我寫的重命名運行后沒反應?(文件名還是1.txt)
- 2 回答
- 0 關注
- 931 瀏覽
添加回答
舉報
0/150
提交
取消