问题描述
我正在看书,在这里,给出了这样的程序-
#include<fstream>
#include<string>
#include<vector>
int main()
{
string filename; // #1
cout << "Please enter name of file to open : ";
cin >> filename;
if(filename.empty())
{
cerr << "Something...";
}
ifstream inFile(filename.c_str()); // #2
if(!inFile)
{
cerr<< "Somthing...";
}
.
.
.
}
解释段说,声明语句显示 声明的位置 ,对此进行了解释
声明语句出现在首次使用已定义对象的位置。
我对该句子感到非常困惑,我无法理解其实际含义。我需要一些例子的解释。
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)