تعلم لغة الكمبيوتر — الصفحة ٢٥٩

printf("\nClosing file %s\n", FN); fclose(fp); printf("\nPress (space) to continue..."); getchar(); } /* end main() */ putrec(name, age, fp) char name[]; int age; /* write a record to file */ FILE *fp; { char s[MAXL]; putstriname, fp); sprintf("%d", age); putstris, fp); */ /* write string to file /* convert int to string */ /* write string to file */ ร /* end putrec() */ put str(s, fp) char s[]; FILE *fp; ເ int i; i = 0; while (s[i] != NULL) { putc(stil, fp); /* write a string to file */ / put character to file */ i++; } putc(NEWLINE, fp); } /* end putstr() */ getree(name, age, fp) char name[]; int *age; FILE *fp; [ char s[MAXL]; int c; Y09 /* newline to sepatate */ /* read a record from file */
ص ٢٥٩

النص مستخرج آليًّا من صور الكتاب، وقد يقع فيه خطأ.