- Karl Heinz Buchegger kb ****** @ gascad.at 即:在标准C ++中 您的平台可能包含执行此操作的功能。请查阅您的 文档或在专属于您的平台的新闻组中询问。 - Karl Heinz Buchegger kb******@gascad.at 我不知道.net环境中的'File.Move'是什么,但这可能是你要找的那个:/ b $ b: #include< cstdio> int main(无效) { std :: rename(" old_name"," new_name"); 返回0; } (为简洁起见,省略了错误检查。) 马丁 - , - 。 Martin Dickopp,德国德累斯顿,=, - _-。 =。 /, - ) http://www.zero -based.org/ ((_ /)oo(\_)) \` - ''` - ''(。)` - '' ` - 。 Debian,GNU操作系统的一种变体。 \_ / Hi,Would like to know how to move a file in c++ programmatically.Something likeFile.Move in .net environment.I am not looking atInvoking the ''move'' command through the ''System''.OrLooking at creating the file and copying the contents and deleting the same.CheersSupreeth 解决方案The later is exactly the way to go.Write the function once and add it to your toolkit library.--Karl Heinz Buchegger kb******@gascad.at The later is exactly the way to go. Write the function once and add it to your toolkit library.That is: in standard C++Your platform may contain a function to do that. Consult yourdocumentation or ask in a newsgroup dedictaed to your platform.--Karl Heinz Buchegger kb******@gascad.atI have not idea what `File.Move'' in the .net environment is, but this isprobably what you''re looking for:#include <cstdio>int main (void){std::rename ("old_name", "new_name");return 0;}(Error checking omitted for brevity.)Martin--,--. Martin Dickopp, Dresden, Germany ,= ,-_-. =./ ,- ) http://www.zero-based.org/ ((_/)o o(\_))\ `-'' `-''(. .)`-''`-. Debian, a variant of the GNU operating system. \_/ 这篇关于文件以编程方式移动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持! 上岸,阿里云!
08-31 03:50