Saturday, December 17, 2011

How to make a .exe file copy program?

how should i make an c program that copies 2 exe files? i can't use fgetc() to copy character by character, And i dont know how to use fread() or fwrite() in this situation (because these functions need a variable to input the data in, and i dont know the data type of the binary symbols present int that file). So please write back a program.|||The 'fread' and 'fwrite' functions take 'void' pointers. They don't care what type the data is and you shouldn't either. For example (note that there's no error checking here):





void copy(FILE *infile, FILE *outfile)


{


char buf[256];


int i;


while(1)


{


i=fread(buf, 1, 256, infile);


if(i%26lt;=0) return;


fwrite(buf, 1, i, outfile);


}


}|||If you are sharing with a friend who uses J, the only files you need to send are the program file (AS) and data, images, sounds, etc., for your program. If your user does not have J, you can still share your program by creating an EX file.|||yes it easy and basic to learn in programming languages.

No comments:

Post a Comment