In the Project options the processor is ARM Cortex M4 The debug mode is simulation
I am running the following application code #include<stdio.h> #include <stdlib.h>
FILE *fid;
int main(void) { int a; char buff[20];
fid = fopen("E:\\Testing\\keil_projects\\datar_proj\\readfile\\read.log","r"); if(fid == NULL) { a = a +1; } fread(buff,1,10,fid); fclose(fid); a = a + 1; printf("i am indian\n"); return 0; }
There are no build errors. When the code is run, the contents of the buff variable are and not as expected.
If you run your program on the PC, I can see why you expect to be able to open the files on the hard-disk of your PC.
But if you compile your program for use on an embedded processor, and you then simulate that processor - why are you so convinced that the embedded processor will be able to access one of the hard-disks of your PC?
If you power up a nice, cool, alarm clock - do you then expect that alarm clock to read files from your PC? If you turn on the ignition of your car - do you then expect your car to read files from your PC?