i have been working with vidoe files and my task is open a video file, get it copied into another file and then changing into binay format. after getting few bits inverted, changing back it into ascii formats. original video contains normal and extended ascii codes. unfortunately, i got stuck at first step, whole video file is not being copied. i have wirtten a piece of code that copies the whole word/ any text file but the video file is not fully copied as just 5KB out of 119,659 KB are copied. plz see the code and help me out
Code:
#include "stdafx.h"
int _tmain(int argc, _TCHAR* argv[])
{
FILE *fp1,*fp2;
char c;
fp1 = fopen( "sample.mpg", "r") ;
fp2 = fopen("result.txt","w");
c = getc(fp1) ;
while ( c != EOF)
{
putc( c, fp2);
c = getc( fp1 ) ;
}
fclose ( fp1 );
fclose(fp2);
}