When I put the following code in a loop it will not write to the file. When I take it out of the loop it works fine (I realize that for now it is an infinite loop as that is part of the assignment). Any suggestions?
Thanks!Code:while(!done) { printf("Enter line #%d: ",line_count++); if (fgets(user_line,MAX_LINE_LENGTH,stdin) == NULL) { fprintf(stderr,"Error reading user input: %s\n", strerror(errno)); } if (fputs(user_line,memo_pntr) == EOF) { fprintf(stderr,"Error writing to file %s: %s\n",memo_file_path, strerror(errno)); } }



LinkBack URL
About LinkBacks


