fork download
  1. #include <stdio.h>
  2. #include <stdlib.h>
  3.  
  4. int main(void) {
  5. // your code goes here
  6. char mytext[32];
  7. FILE *fp = fopen("myfile", "w");
  8. fputs("30", fp);
  9. fputs("32", fp);
  10. fclose(fp);
  11. fp = fopen ("myfile", "r");
  12. fgets(mytext, sizeof(mytext), fp);
  13. printf("mytext: %s-", mytext);
  14. fclose(fp);
  15. return 0;
  16. }
  17.  
Runtime error #stdin #stdout 0s 9416KB
stdin
Standard input is empty
stdout
Standard output is empty