M
Medvedev
FILE *a,*b;
int z;
char str1[2];
char str2[2];
a= fopen(argv[0],"rb"); //Both files are EXE's
b= fopen(argv[1],"rb+");
z= fread(str1,1,1,a);
if (z !=1)
printf("-101");
z= fread(str2,1,1,b);
if (z !=1)
printf("-102");
if(str1 == str2)
{
fwrite("a",1,1,b); // here it don't change the first
byte of the entered file "b" why!
printf("OK");
}else{
fwrite(str1,1,1,b);
printf("NO");
}
fclose(a);
fclose(b);
int z;
char str1[2];
char str2[2];
a= fopen(argv[0],"rb"); //Both files are EXE's
b= fopen(argv[1],"rb+");
z= fread(str1,1,1,a);
if (z !=1)
printf("-101");
z= fread(str2,1,1,b);
if (z !=1)
printf("-102");
if(str1 == str2)
{
fwrite("a",1,1,b); // here it don't change the first
byte of the entered file "b" why!
printf("OK");
}else{
fwrite(str1,1,1,b);
printf("NO");
}
fclose(a);
fclose(b);