Question: 3. Checkpoint 3: For the third and final checkpoint, write a C program to read a text file into memory one line at a time.

 3. Checkpoint 3: For the third and final checkpoint, write a

3. Checkpoint 3: For the third and final checkpoint, write a C program to read a text file into memory one line at a time. Use fgets ) to accomplish this. And assume a line is no more than 128 bytes long, meaning you can declare a character array buffer as char line [128]. Next, without using square bracket [ notation or any int (or other numeric) variables what- soever, traverse each line and display each alphanumeric character you find. To accomplish this, use pointer arithmetic and the isalnum) function in ctype.h At the end of each line, display the total number of alphanumeric characters found on that line. Use the format shown in the example below. Again, do not use any int or other numeric variables to accomplish this Finally, if no alphanumeric characters are found on a given line, do not display anything, not even a blank line To test your code, start with small test cases, then download the book-1984.txt file and test with that as input. Your output in this case should start as follows PARTONE [7 alnum chars] Chapteri [8 alnum chars] ItwasabrightcolddayinAprilandtheclockswerestrikingthirteen [58 alnum chars] WinstonSmithhischnnuzzledintonisbreastinanefforttoescapethe [60 alnum chars] vilewindslippedquicklythroughtheglassdoorsofVictoryMansions [59 alnum chars] thoughnotquicklyenoughtopreventaswirlofgrittydustfromentering [61 alnum chars] alongwithhim [12 alnum chars] HINT: Use pointer arithmetic to achieve this checkpoint

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!