:)
Like I said, a nice trick.
Just takes a little bit more code to get around it (ie -no lib functions). I was also referring to some of the other suggestions made in the thread when I talked about the (completely artificial) restrictions on what I was allowed to do.
Here's my line:
if (charval < 0 || charval > 9)
Cut'n'pasted directly from the source. I can see how you're version is a bit more efficient... but hey, this is the first non-trivial C program I've ever written: "printf("Hello, world!")"
Not that the problem set isn't pretty trivial, but hey, we all gotta start somewhere, right?
--\n-------------------------------------------------------------------\n* Jack Troughton jake at consultron.ca *\n* [link|http://consultron.ca|http://consultron.ca] [link|irc://irc.ecomstation.ca|irc://irc.ecomstation.ca] *\n* Kingston Ontario Canada [link|news://news.consultron.ca|news://news.consultron.ca] *\n-------------------------------------------------------------------