Iam beginer in this field. While trying a code to implement fprintf & fscanf, iam getting errors.
Please help to explain the cause of error.
Code Snippet
#include <stdio.h>
int main ()
{
FILE *fp;
int num;
char sstr[100];
fp = fopen("myText.txt", "w");
fprintf(fp,"%d %s",9898,"visakh");
/*sscanf(fp, "%f %s",&ffloat,sstr);
printf("Float = %f\n",ffloat);
printf("String : ");
puts(sstr);*/
//rewind(fp);
fscanf(fp,"%d",&num);
fscanf(fp, "%s",sstr);
printf("NUM = %d\n",num);
printf("String : %s",sstr);
//puts(sstr);
fclose(fp);
return 0;
}