M
Medvedev
when i try to read the first byte from an EXE file it's give different
results
code:
FILE *me,*u;
char buf_me[1];
char buf_u[1];
me= fopen(argv[0],"rb");
u= fopen(argv[1],"rb+");
fread(buf_me,sizeof(char),1,me);
fread(buf_u,sizeof(char),1,u);
printf("%s\n",buf_me);
printf("%s\n",buf_u);
----
when you run this code and put EXE file as an argument , the program
will print
M
MM
why it double the byte in the second time
results
code:
FILE *me,*u;
char buf_me[1];
char buf_u[1];
me= fopen(argv[0],"rb");
u= fopen(argv[1],"rb+");
fread(buf_me,sizeof(char),1,me);
fread(buf_u,sizeof(char),1,u);
printf("%s\n",buf_me);
printf("%s\n",buf_u);
----
when you run this code and put EXE file as an argument , the program
will print
M
MM
why it double the byte in the second time