home *** CD-ROM | disk | FTP | other *** search
/ C by Discovery (4th Edition) / C_By_Discovery_4th_Edition.tar / C_By_Discovery_4th_Edition / CH_05 / 303.jpg < prev    next >
Joint Photographic Experts Group Image  |  2013-12-12  |  727KB  |  2550x3300
Labels: book | box | reckoner | shelf
OCR: Examples with strlen( and strchr() 303 The program consists of the single function main( One array of type char "words and two char variables are defined After the input IS done a while loop haracters used to process the array that holds the input line Each iteration of the while loop line of outputs one "..IOM, separate Note The pointer lastpos will always point to the beginning of the word to be output; currentpos will point to the end of the Note 2 The buffer instri ing is initialized by a call to fgets ( Note 3 The call to strchr ( begins its search for blank character at the memory location pointed to by astpos It returns pointer to the first blank character. If no blank is found before the terminating null charac- ter, strchr returns NULL pointer. In this program, the return of a NUL ...