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 / 595.jpg < prev    next >
Joint Photographic Experts Group Image  |  2014-01-29  |  800KB  |  2550x3300
Labels: book | crt screen | poster | reckoner
OCR: 10.7 Random versus Sequential Access in Files 595 ce numrecs long int getnumrecs( FILE long int fseek( fp, long Note numbytes ftell( Note numbytes returr numb struct trans ( else return This program consists of the functions main read ans main opens print trans browse ( and getnumrecs ) The function the file "transact" calls ge tnumrecs calculate the number of records the file, issues some messages to the user and calls the function browse browse through the file Note 1:In this call fopen () the file "transact is opened with mode this allows both reading and writing to the file The file contents are left intact when the file is opened The modes and also allow both reading and writing: with "w+" any existing file contents are destroyed when the file is opened, and with "at writes to the fil ...