ICS 103: Computer Programming in C Handout-8 Topic: Data Files. Objective: • To know why Data Files are needed. • To Know How to Use Data Files for Input. • To Know How to Use Data Files for Output. What is the Need of Data File ? : Data files are two types: one is input data file and another is output data file. If you want that your input data should be permanently store in input data file and you want to use this data file at any later time. For this first create input data file in some secondary storage device then input data and save data in this input file permanently (in place of simply taking data temporarily from keyboard) doing this our input data will be permanently stored in this input data file and we can simply use this file any time. Similarly we can save our outputs in Output data file permanently in place of simply displaying outputs only on the screen of computer . Important Statements/Functions for handling I/O Data files : List of Some useful Functions/Statements and their purpose is explained below : FILE *inp, *outp; // Makes cells named inp and outp for storage of file pointers.
- Spring '10
- Input/output, input file, input data file, outp