home *** CD-ROM | disk | FTP | other *** search
/ C by Discovery (4th Edition) / C_By_Discovery_4th_Edition.tar / C_By_Discovery_4th_Edition / CH_11 / 631.jpg < prev    next >
Joint Photographic Experts Group Image  |  2013-12-20  |  634KB  |  2550x3300
Labels: book | crt screen | daybook | poster | reckoner
OCR: 11.5 Dynamic Allocation and De-allocation of Memory 631 contents of the whole file. single fread() will read the contents of the file and place in the allocated buffer The contents of that buffer displayed one record at time The technique of reading the whole file in one disk access and lallocating exactly the needed amount of memory efficient in both memory use and execu- tion time sput. input? Tectly 11-8 calloc.c Example are call rary OC vords struct Synopsis Reads transact ions (elements of type trans) from file into dynami ically 1 located av and displays them on standard output Obj ective To il lustrate the use of cal loc allocating able on space for an array of structures own Inc lude Files #incl Lude <stdio #incl Lude <stdl ib h> Constant Definiti ons Note 1 #define BUF SIZE 80 ing ...