Discussion: parsing error
Afficher un message
Vieux 01/07/2008, 06h48   #1
Medvedev
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut parsing error

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
  Réponse avec citation
 
Page generated in 0,05080 seconds with 9 queries