| | |
copy a file
Please support our C++ advertiser: Intel Parallel Studio Home
![]() |
•
•
Join Date: Feb 2008
Posts: 517
Reputation:
Solved Threads: 1
If I have a file like this and I want to copy this "File1" to "File2", how is this possible to do.
So I will copy File1 so the new file with have the name "File2.txt".
I know that:
std::copy member exists but are not really sure how to use it.
So I will copy File1 so the new file with have the name "File2.txt".
I know that:
std::copy member exists but are not really sure how to use it.
C++ Syntax (Toggle Plain Text)
"C:\\File1.txt"
•
•
Join Date: Dec 2006
Posts: 1,089
Reputation:
Solved Threads: 164
c++ Syntax (Toggle Plain Text)
std::ifstream fin( "file1.txt" ) ; std::ofstream fout( "file2.txt" ) ; fout << fin.rdbuf() ;
•
•
Join Date: Feb 2008
Posts: 517
Reputation:
Solved Threads: 1
That worked great. Thanks.
•
•
•
•
c++ Syntax (Toggle Plain Text)
std::ifstream fin( "file1.txt" ) ; std::ofstream fout( "file2.txt" ) ; fout << fin.rdbuf() ;
![]() |
Similar Threads
- how to copy a file (Python)
- Copy file with a name change (ASP)
- Cannot copy file: Data error (cylcic redundancy check) (Windows NT / 2000 / XP)
- how to copy a file from one machine to another using beans? (Java)
- copy a file (Python)
- Cannot copy file: Data error (cylcic redundancy check) (Windows NT / 2000 / XP)
- Windows XP Pro install on new machine "could not copy file .." (Windows NT / 2000 / XP)
Other Threads in the C++ Forum
- Previous Thread: problem in constructing two dimensional array in c++ using classes
- Next Thread: selection sort algorithm
| Thread Tools | Search this Thread |
Tag cloud for C++
6 add api array arrays beginner binary bmp c++ c/c++ calculator char class classes code compile compiler console conversion convert count data delete desktop directshow dll download dynamic encryption error file forms fstream function functions game givemetehcodez google graph gui iamthwee ifstream input int java lib library lines linkedlist linker loop looping loops map math matrix memory microsoft newbie news number output pointer problem program programming project python random read recursion recursive reference return sort string strings struct studio system temperature template templates test text text-file tree unix url variable vector video visual visualstudio void win32 windows winsock wordfrequency wxwidgets






