1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29
| #include <fstream> // std::ifstream, std::ofstream
#include <string> // std::string, std::getline()
#include <iostream> // std::endl
// std::ifstream, std::ofstream
int main ()
{
std::ifstream fic_in1,fic_in2 ;
std::ofstream fic_out;
char tampon;
fic_in1.open("toto.txt");
fic_in2.open("t2.txt");
fic_out.open("t.txt");
while (!fic_in1.eof())
{
fic_in1>>tampon;
fic_out<<tampon;
}
while (!fic_in2.eof())
{
fic_in2>>tampon;
fic_out<<tampon;
}
fic_in1.close();
fic_in2.close();
fic_out.close();
} |