Exercise 02 - Pointers / Arrays / Strings

Out: Wednesday January 10, 2018
Due: Friday January 12, 2018 by 11:59pm.
Note the unusual due time.


  1. We provide some source that "nearly works," as well as a fully working makefile and a fully working executable. The files are here.

  2. Fix the source. When you're done it should get the same result as the solution executable.

  3. The source is written in somewhat dense C. What it does, though, is prints any command line arguments after having reversed them, and then prints "literal string" reversed. For example, here is a sample run:
    $ ./ex02 one two three four
    'eno'
    'owt'
    'eerht'
    'ruof'
    'gnirts laretil'
    

  4. Note that do not need to write any new lines of code to implement the needed fixes.

  5. It's expected that there will be something in or about the C code that you're not familiar with. Please do not just post to the class forum asking what some statement or C construct means. If you need help, (a) that's okay, it's expected, and (b) please ask the course staff. A post whose answer gives away the essence of the exercise turns it into just typing, rather than learning, for everyone who sees it.

  6. Hand in to the course dropbox:
(The following are generic requirements that will appear every exercise. Exactly how pertient they are can vary from one exercise to another.)

Your code must: