F
fazulu deen
Hi all,
I have to read two text file(opcode,jump)...
I guess the following statements are correct(but it is not reading
the data
from that files and also not checking the presence of the files,why
so??)
unsigned h, i=0;
FILE *fp = fopen("opcode.txt","r");
if(fp)
{
while(!feof(fp))
{
fscanf(fp,"%x", &h);
mem_opcode[i++] = h;
}
}
else
printf("Can not open %s file\n","opcode.txt");
unsigned h, i=0;
FILE *fp = fopen("jump.txt","r");
if(fp)
{
while(!feof(fp))
{
fscanf(fp,"%x", &h);
mem_opcode[i++] = h;
}
}
else
printf("Can not open %s file\n","jump.txt");
I have only included iostream
whether the above statements for read operation is correct??Anything i
missed....pls suggest
the modification....
regards,
fazal
I have to read two text file(opcode,jump)...
I guess the following statements are correct(but it is not reading
the data
from that files and also not checking the presence of the files,why
so??)
unsigned h, i=0;
FILE *fp = fopen("opcode.txt","r");
if(fp)
{
while(!feof(fp))
{
fscanf(fp,"%x", &h);
mem_opcode[i++] = h;
}
}
else
printf("Can not open %s file\n","opcode.txt");
unsigned h, i=0;
FILE *fp = fopen("jump.txt","r");
if(fp)
{
while(!feof(fp))
{
fscanf(fp,"%x", &h);
mem_opcode[i++] = h;
}
}
else
printf("Can not open %s file\n","jump.txt");
I have only included iostream
whether the above statements for read operation is correct??Anything i
missed....pls suggest
the modification....
regards,
fazal