For the fscanf function you should pass the address of a,  change following 2 
lines in your code as follows and have a try:
  if ( fscanf(fptr,"%d",&a) ) {  
printf("%d",a);

  Regards,
  Sachin

  

ÍõÀÚ <[EMAIL PROTECTED]> wrote:
          I use fscnaf like the:

FILE *fptr;

int a;

fptr = fopen("input","r");

if ( fscanf(fptr,"%d",a) ) {

printf("%d",&a);

}

else printf("wrong");

fclose(fptr);

But it can not run successfully.

[Non-text portions of this message have been removed]



                         

       
---------------------------------
Looking for last minute shopping deals?  Find them fast with Yahoo! Search.

[Non-text portions of this message have been removed]

Reply via email to