[实用程序源码及工具软件] C++判断文件存在源码

[复制链接]
 楼主| hotpower 发表于 2023-9-18 23:15 | 显示全部楼层 |阅读模式
  1. bool Exists(const string& filename)
  2. {
  3.         bool result = false;
  4.         ifstream ifs;
  5.         ifs.open(filename.c_str(), ios::in);
  6.         if (ifs.is_open()) {
  7.                 ifs.close();
  8.                 result = true;
  9.         }
  10.         return result;
  11. }


您需要登录后才可以回帖 登录 | 注册

本版积分规则

个人签名:[url=http://www.21ic.com/tools/HotWC3_V1.23.html]

1460

主题

21619

帖子

508

粉丝
快速回复 在线客服 返回列表 返回顶部
个人签名:[url=http://www.21ic.com/tools/HotWC3_V1.23.html]

1460

主题

21619

帖子

508

粉丝
快速回复 在线客服 返回列表 返回顶部