i hav used like this
in output its displaying ilke this
enter filename
test.cpp//filename
input string is a+b ------(- indicates garbage value here)
i mean iam getting contents of file as wel as garbage value
pls help me
Code:
char mstr[50];
file *fp;
char *fname;
printf("enter d file name\n");
scanf("%s",fname);
fp=fopen(fp,"r");
fread(mstr,1,50,fp);
lex-ana(mstr);//passing to constructor
.
.
.
enter filename
test.cpp//filename
input string is a+b ------(- indicates garbage value here)
i mean iam getting contents of file as wel as garbage value
pls help me
Comment