簡要敘述下列程式代碼,并判斷如下程式的功能:
#include <fstream>
#include <iostream>
using namespace std;
int main(int argc, char* argv[])
{ char c;
fstream fio(argv[1], ios::in | ios::out);
if (fio.fail()) //打開檔案成功與否監控
{ cerr << "Cannot open file:" << argv[1] << endl; return 1; }
while((c=fio.get())!=EOF) //判斷是否到達檔案末尾
if (isupper(c))
{ fio.seekg(-1, ios::cur); fio.put(tolower(c)); }
fio.close();
return 0;
}
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/78815.html
標籤:C++ 語言
上一篇:c++
下一篇:求教一問題
