您当前的位置: 首页 >  c++

令狐掌门

暂无认证

  • 0浏览

    0关注

    513博文

    0收益

  • 0浏览

    0点赞

    0打赏

    0留言

私信
关注
热门博文

C++判断文件或文件夹是否在,不存在则创建

令狐掌门 发布时间:2020-03-05 02:48:55 ,浏览量:0

一  判断文件是否存在, 不存在则创建

       使用文件流fstream打开,

#include 
#include 

using namespace std;

void isFileExist()
{
	const char* fname = "D:\\ASDF\\1234.txt";

	fstream fs;
	fs.open(fname, ios::in);

	if (!fs)
	{
		cout             
关注
打赏
1652240117
查看更多评论
0.0376s