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 / 629.jpg < prev    next >
Joint Photographic Experts Group Image  |  2013-12-20  |  783KB  |  2550x3300
Labels: book | reckoner | shelf
OCR: Celeron a 11.5 Dynamic Alloca ation and De-allocation of Memory 629 free(( void word return 0; The program consists of the single function ma in {} The variable instring is pasn to hold line of input from standard input. The pointers cu rrentpl and endword are used as pointers into instring to mark the beginning and the end and each of the individual words. The variable piom will point to a separate buffer with in call mem- ory where the individual words are to be copied. Input is done fge ts The whi loop works through the line of input. picking out the end 01 each prrm with a call to strchr The last word in the buffer instr ing is pro- cessed after the while loop terminates. Note 1:In ANSI the memory allocation functions are declared in the file stdlib.h Note 2: The string library functio ...