fork download
  1. #include <stdio.h>
  2.  
  3.  
  4. void my_read(FILE *fp,int *n,int *s) {
  5. char ch;
  6.  
  7. while ((ch = fgetc(fp)) != EOF)
  8. if (ch == 'n')
  9. fscanf(fp, "%d", n);
  10. else if (ch == 's')
  11. fscanf(fp, "%d", s);
  12.  
  13. }
  14.  
  15. int main(void) {
  16. FILE *file;
  17. int n,s;
  18.  
  19. fp = fopen("xxx", "r");
  20.  
  21. my_read(fp, &n, &s);
  22.  
  23. return 0;
  24. }
Not running #stdin #stdout 0s 0KB
stdin
Standard input is empty
stdout
Standard output is empty