Problem Description:
A second file is required to be stitched to the end of the first file. such as the file2 stitching to the end of file. (Just copy it soon!) But the teacher does not let the programming, really is the egg ache!! )。 For example:
File1:i am not responsible of this code. They made me write it, against my'll. File2:when I wrote this, only God and I understood what I was doing. Now, God is only kowns. After stitching: file1:i am not responsible of this code. They made me write it, against my'll. When I wrote this, only God and I understood what I was doing. Now, God is only kowns.
Knowledge Points: File stream classes.
#include <iostream>#include<fstream>using namespacestd;Const intMAXN = ++Ten;intMain () {CharSTR[MAXN]; Ifstream Cin ("File2.txt"); Ofstream cout ("file1.txt", Ios::app); while(Cin.getline (str, MAXN)) {cout<<str<<Endl; } return 0;}
Do not copy in a week! In case the work is identical!
C + + implements the stitching of two files.