It was thus said that the Great Ian King once stated:
I used to ask college grads to write a function in C to convert a
null-terminated string representing an octal number into an int. My
primary goal was to observe their coding habits, but the radix-8 aspect of
the problem scuttled a lot of them! What was really sad was how many had
trouble with type itself: realizing that a C int type is nothing more than
an abstraction ascribing a meaning to a bit pattern. Many couldn't help
but think of an int as a hex number - or in some cases, a decimal one.
Ah, but what about the student that uses strtol() or strtoul() (depending
on if negative numbers are required)?
About a decade ago, a friend of mine was interviewed for a C programming
job, and was asked to read in a list of numbers and store them in a linked
list (single pointer), within an hour (and yes, that's all the program had
to do). When he finished in thirty minutes (after extensive testing to make
sure it worked) he was told he was the *only* candidate to have finished the
program in the alloted time frame.
-spc (True story---I even knew the interviewer ... )