K&R Exercises

Exercise 5-6: getline and reverse with pointers

Rewrite appropriate programs from earlier chapters and exercises with pointers instead of array indexing. Good possibilities include getline (Chapters 1 and 4), atoi, itoa, and their variants (Chapters 2, 3, and 4), reverse (Chapter 3), and strindex and getop (Chapter 4).

Write pointer versions of getline and reverse, and use them in a program that prints each input line reversed, without its newline. Lines are at most 1000 characters.

Test Cases

· space→ tab↵ newline

Submissions

No submissions yet