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 / 639.jpg < prev    next >
Joint Photographic Experts Group Image  |  2013-12-20  |  650KB  |  2550x3300
Labels: book | crt screen | poster | reckoner
OCR: A Linked List -The Theory and an Example 639 Example 11-11: linklist.c: function get prrd space() get word space All locates space for the string contai ined ir first parameter Returns poi inter to the byte. char get word space( char *string char *temp; temp char *) calloc( strlen stri ing if temp NULL printf "Out memory for text. \n" exit return temp xt mem- igure member 11 This function dynamically library allocates function the cal loc) memory is used needed to for obtain the space string in for its ar parameter str Lng The array of st elements of size one byte The value returned bi ca oc checked to make sure that the memory allocation S successful If was not the program 1S terminated with an message If it was successful. the address of the first byte of the buffer returned Example 11-1 ...