#include <stdio.h> #include <dir.h> int main(void) { FILE *fp; char *fname = "TXXXXXX", *newname, first; newname = mktemp(fname); fp = fopen(newname,"w+"); fprintf(fp,"abcdefghijklmnopqrstuvwxyz"); rewind(fp); fscanf(fp,"%c",&first); printf("The first character is: %c\n",first); fclose(fp); remove(newname); return 0; }