S
Sebastian Becker
Hello NG,
is fscanf capable of reading a memory adress from a file? I tried to
find the right format-parameter, but my code doesn't seem to work...
Regards,
Sebastian
----cut-----
int i=120;
int *a;
FILE *Outfile;
if ((Outfile = fopen("tst.dat","w"))== NULL) //open
{
if ((Outfile = fopen("tst.dat","w+"))==NULL) //create
{
printf("Error opening file\n");
exit();
}
}
printf("%p\n",&i);
fprintf(Outfile,"%p\n",&i);
fclose(Outfile);
Outfile = fopen("tst.dat","r");
fscanf(Outfile,"%p",a);
fclose(Outfile);
printf("%p",a);
----cut-------
is fscanf capable of reading a memory adress from a file? I tried to
find the right format-parameter, but my code doesn't seem to work...
Regards,
Sebastian
----cut-----
int i=120;
int *a;
FILE *Outfile;
if ((Outfile = fopen("tst.dat","w"))== NULL) //open
{
if ((Outfile = fopen("tst.dat","w+"))==NULL) //create
{
printf("Error opening file\n");
exit();
}
}
printf("%p\n",&i);
fprintf(Outfile,"%p\n",&i);
fclose(Outfile);
Outfile = fopen("tst.dat","r");
fscanf(Outfile,"%p",a);
fclose(Outfile);
printf("%p",a);
----cut-------