home *** CD-ROM | disk | FTP | other *** search
/ C by Discovery (4th Edition) / C_By_Discovery_4th_Edition.tar / C_By_Discovery_4th_Edition / CH_10 / 586.jpg < prev    next >
Joint Photographic Experts Group Image  |  2014-01-29  |  643KB  |  2550x3300
Labels: book | crt screen | monitor | reckoner
OCR: 586 Chapter Input and Output printf "Unable to open input file. in" ); exit Open output files and report any errors name fopen( "names NULL print f. "Unable open names n" exit if (( gpa fp fopen( "gpas", "w" == NULL printf "Unable .0 open edb file In" exit( while fgets( inbuff, BUF SIZE, fp NULL Note sscanf( inbuff, %lf%*c first, last, &gpa Note 2 fpri intf( name fp, %s\n" last, first fprintf( gpa fp, 114 In" gpa fc lose fci lose name fp fc. Lose gpa fp return 0; This program consists of a single function. main The three if statements open the input file ud info, and the two output files, names and gpas. If an error occurs while opening any of the files an error message 19 issued and the pro- gram terminates The whi ile loop processes the contents of the input file Each iteration of the lo ...