在VC ++中重命名文件 [英] renaming file in vc++
本文介绍了在VC ++中重命名文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何在vc ++ 6.0中重命名文件?
How to rename a file in vc++ 6.0?
推荐答案
一个简单的Google使用在vc ++ 6.0中重命名文件" 问题 给出了很好的结果:
http: //www.google.co.uk/search?sourceid=chrome&ie=UTF-8&q=rename+a+file+in+vc%2B%2B+6.0 [ http://www.daniweb.com/software-development/cpp/threads/129511 [ ^ ]
Google是您的朋友:很好,经常拜访他.与在此处发布问题相比,他可以更快地回答问题...
A simple google using "rename a file in vc++ 6.0" pasted from your question gave good results:
http://www.google.co.uk/search?sourceid=chrome&ie=UTF-8&q=rename+a+file+in+vc%2B%2B+6.0[^]
The top link even gives you the code!
http://www.daniweb.com/software-development/cpp/threads/129511[^]
Google is your friend: Be nice and visit him often. He can answer questions a lot more quickly than posting them here...
真的为此尝试了google,
但我的一小段代码可能会对您有所帮助,
Really tries google for this,
but my small bunch of code may help you,
include <stdio.h>
int main ()
{
int result;
char oldname[] ="oldname.txt";
char newname[] ="newname.txt";
result= rename( oldname , newname );
if ( result == 0 )
puts ( "File successfully renamed" );
else
perror( "Error renaming file" );
return 0;
}
这篇关于在VC ++中重命名文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文