aboutsummaryrefslogtreecommitdiff
path: root/ch5 (follow)
AgeCommit message (Collapse)AuthorFilesLines
2015-01-30Solve Exercise 5-18: error-recovering `dcl`zlg1-0/+172
This exercise was a real pain in the ass. The original use of getch() and ungetch() was inferior to a line-based approach. It really doesn't seem like the way a parser should be built, but it taught me a little about the order of recursion. I'm convinced that a debugger is necessary if you want to build a good parser. This implementation doesn't recurse in a natural way, or even enough to stack data type prefixes. Hopefully by the time I get to 5-20 I'll have enough ideas to implement something that *does* recurse well.
2014-06-15Solve Exercise 5-17: field sortingzlg2-1/+268
2014-05-21Refactor flag handlingzlg3-24/+51
2014-05-20Solve Exercise 5-16: directory-ordered `tail`zlg1-0/+191
2014-04-08Remove line_tolower()zlg1-9/+0
2014-04-08Solve Exercise 5-15: Case-insensitive sortzlg2-1/+179
2014-03-20Solve Exercise 5-14: reverse sortzlg1-0/+152
2013-10-18Solve Exercise 5-13: tailzlg1-0/+106
This exercise was somewhat irritating until I caved and used the code in section 5.6 like the exercise suggested. The solution is not what I think is clean, but given that [mc]*alloc haven't been covered yet, it's probably the best one can muster. Once I used the code in ยง5.6, the program fell into place. Still, it was a neat exercise.
2013-10-13Solve Exercise 5-12: flexible `detab` and `entab`zlg2-0/+157
2013-09-26Solve Exercise 5-11: `entab` and `detab` remixed!zlg2-0/+137
This one was pretty rough. At first I wanted to include a bunch of error-catching and "smart" stuff. When I took a second look at it and realized `itoa` returns 0 on a string, things became a bit easier. I may have been able to outsource a few things to a function or two, but overall I think it worked out.
2013-09-24Clean up 5-10's printf() callszlg1-4/+0
2013-09-24Solve Exercise 5-10: exprzlg1-0/+107
2013-09-21Solve Exercise 5-9: day of year functions with pointerszlg1-0/+74
This exercise was fun and taught me a bit about initializing arrays and working with pointers.
2013-09-15Solve Exercise 5-8: Checking for errorszlg1-0/+83
2013-09-11Solve Exercise 5-7: Improved readlines()zlg1-0/+106
2013-09-08Solve Exercise 5-6: pointer-based functionszlg1-0/+154
This exercise was not very fun or interesting. While I somewhat enjoyed learning to use pointers, this was a bunch of busywork. It felt like homework, and that's terrible. It's the first exercise I've outright disliked. If you're writing a programming book, *don't* make exercises like this one!
2013-09-03Solve Exercise 5-5: strn{cpy|cat|cmp}zlg1-0/+76
This exercise seemed like it was designed to "pull it all together" with things learned in the previous few pages. Not much new in terms of techniques, but more a test to see how you could blend everything together.
2013-09-02Solve Exercise 5-4: strend()zlg1-0/+37
Detailed answers below the question will only occur now if I cannot explain myself well enough in code and nearby comments. I'm looking to learn how to write better comments so there's less need for prose.
2013-08-29Solve Exercise 5-3: pointer-powered strcat()zlg1-0/+42
2013-08-19Solve Exercise 5-2: getfloat()zlg1-0/+75
2013-08-13Solve Exercise 5-1: fixed getint()zlg1-0/+65