Chapter 9

A3: Every space will count as one word. Two possible modification schemes are to peek at the next character (this is tricky to do correctly) or to remember the last character seen (more straightforward).
A4: Yes, the function scanf could match spaces between words.
A5: Could you test either for a null up through the last cell of the buffer or for reaching that last cell without finding a null?
A6: If the first string is ONE and the second is ON, that test would not trigger the necessary swap to move ON before ONE.
A7: SORTSTR as written would need 10 traversals, each involving 7 instructions.
A8: Perform a range check (A–Z) on a scratch copy of each character, and then force those copies either to uppercase or to lowercase before the equivalent ...

Get Itanium® Architecture for Programmers: Understanding 64-Bit Processors and EPIC Principles now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.