首页上一页 1  下一页尾页 2 条记录 1/1页
        有何错误(如何更改)
                 	
                        发表在VC++图书答疑
                        2017-10-14                        
悬赏:5 学分                        
                    		
                            《Visual C++从入门到精通(第4版)》第15章  文件与注册表操作                                                	
                        
                        
                    
                    
                    	是否精华
                    	是
                    	否
                    
                    
                    
                            版块置顶:
                            是
                            否
                        
                    如下代码:::
错误在图片中

#include <io.h>
#include "stdafx.h"
#include <iostream>
#include <cstring>
#include <string>
using namespace std;
//读取文件夹设定
const string path = "D:\\pp\\";
int main()
{
_finddata_t file;
long lf;
if ((lf = _findfirst((path + "*.*").c_str(), &file)) == -1)
cout << "Not Found!" << endl;
else {
// cout<<"file name list:"<<endl;
while (_findnext(lf, &file) == 0) {
{
string str = file.name;
//修改扩展名为.jpeg
str += ".jpeg";
//重命名文件
if (rename((path + string(file.name)).c_str(), (path + str).c_str()) == 0)
{
//cout << "1" << endl;
}
}
}
}
_findclose(lf);
return 0;
}

	
                                                
购物车
发表新帖
立即签到
                    
                






