Link to home
Start Free TrialLog in
Avatar of sudarshantk
sudarshantkFlag for India

asked on

Compilation Errors

warning: unused variable `fp'
Even though I am using the fp variable
 fp=fopen("Reader.xml", "rb");
fgets(Buff, sizeof(Buff), fp);
Anyone know why...
Avatar of grg99
grg99

Try turning off optimization, soemtimes the compiler is too clever.

Also make sure that code is reachable, and not accidentally in a comment or #ifdef or a if( 0 )

Hi sudarshantk,

FILE * fp; // Will cause a warning.

...

{
  FILE *fp;
  ...
  fp=fopen("Reader.xml", "rb");
  fgets(Buff, sizeof(Buff), fp);
 
}

Perhaps you could post a little more code.

Paul
i din't see any complie error on my VC. by the way try with adding this line on your code for initialization.

FILE *fp=NULL;

regards
marchent
ASKER CERTIFIED SOLUTION
Avatar of DineshJolania
DineshJolania

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of sudarshantk

ASKER

Thanks