1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
| //copie du fichier source
std::ifstream source( "C:\\..\\video0.avi",std::ios_base::binary );
std::ofstream destination( "C:\\..\\video.avi",std::ios_base::binary );
char buff[4096];
while ( !source.eof() )
{
source.read ( buff, sizeof( buff ) );
destination.write ( buff, source.gcount() );
}
//on rajoute le fichier file a file1
std::ifstream file( "C:\\...\\video1.avi",std::ios_base::binary );
//ouverture avec ajout en fin de fichier
std::ofstream file1( "C:\\..\\video.avi", std::ios_base::binary,std::ios_base::app);
while ( !file.eof() )
{
file.read ( buff, sizeof( buff ) );
file1.write ( buff, file.gcount() );
} |
Partager