git传送门
第五次作业新增文件读取与写入。

16-06-10更新:将文件输出放入Print类,文件输入放入Scan类。

string Print::getInfomation(int flag, string res)
{
    switch (flag)
    {
    case -1:
	    return  res;
	    break;
    case 1:
	    return "ERROR : divided by zero ";
	    break;
    case 2:
	    return "ERROR : 输入的数字超过十位(包括小数位)";
	    break;
    case 3:
	    return "ERROR : () don't match";
	    break;
    }

}


void Print::print(string res)
{
    cout << res << endl;
}


void Print::printQue(queue<string> que)
{
    while (!que.empty())
    {
	    cout << que.front();
	    que.pop();
    }
    cout << "= ";

}
void Print::write(string res, ofstream &out)
{
    out << res << endl;
}

else if (argc == 4 && strcmp(argv[1],"-f") == 0) 
{
   sc.read(argv[2], argv[3]);
}

工程框架

《面向对象程序设计》五  文件读取写入

相关文章:

  • 2021-08-23
猜你喜欢
  • 2021-10-20
  • 2021-11-02
  • 2022-01-10
  • 2022-01-20
  • 2021-12-21
  • 2021-05-25
  • 2021-11-07
相关资源
相似解决方案