CIS 1500 Lecture Notes - Lecture 16: Text Editor, Plaintext, Textedit
Document Summary
Announcements: lab exam grades are on moodle now, assignment two grades will be up tomorrow. Files are a great way to permanently store data that your program needs to have each time it runs. Save files, data files, startup parameters, etc. can all go in a file: a file is a type of stream. Streams are just a set of input (might be characters, might be binary) that has no identified endpoint: text files end in a special character called eof. Steps to use text files: declare: you must declare a file * variable for use with the file. File * infile; // file called infile, probably to be opened for reading: open: use the funciton fopen to open a file. Files can be opened in read(r), write(w), or append(a) mode. Additional modes include r+, w+, a+, but should be used carefully.