Sort an array of strings as text, not as numbers

Write a selection-sort program for at most four product-code strings. Input is 0<=n<=4 followed by n tokens, each containing 1..9 decimal digits; these are identifiers, not numeric values. Store them in char code[4][10]. Sort by strcmp order and print codes: followed by the strings, each preceded by one space, then a newline. For the named code sample 4 / 42 7 105 42, explain the resulting order. Show how to swap complete rows legally, and justify every string-copy capacity. Decimal digits have their C-guaranteed increasing order; assume no wider alphabet ordering.


