IWETHEY v. 0.3.0 | TODO
1,095 registered users | 0 active users | 0 LpH | Statistics
Login | Create New User
IWETHEY Banner

Welcome to IWETHEY!

New int isdigit(int c) { return (c >='0' && c <= '9'); }
Like denying you that slows you down any.




In Java, you can't escape the creepy feeling.

     --James Gosling
New :)
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-------------------------------------------------------------------
     I'm having a problem grokking C - (jake123) - (61)
         "\\0" is a string - not a character - (ChrisR) - (54)
             Re: "\\0" is a string - not a character - (jake123) - (23)
                 Double quotes is a string: - (ChrisR)
                 You want to use '0' not "0". - (a6l6e6x) - (21)
                     Thanks guys - (jake123) - (20)
                         sheesh, wackiness - (jake123) - (17)
                             operator precedence -NT - (deSitter) - (3)
                                 According to my text - (jake123) - (2)
                                     use "unsigned char" - (deSitter)
                                     Re: According to my text - (Arkadiy)
                             Should be equivalent indeed - (Arkadiy) - (12)
                                 Well, interestingly enough - (jake123) - (11)
                                     Re: Well, interestingly enough - (Arkadiy) - (10)
                                         Yes, I was sure. -NT - (jake123) - (9)
                                             copy/paste the full code, then -NT - (Arkadiy) - (8)
                                                 Sure, here's my final version - (jake123) - (7)
                                                     Works with or without parens for me - (Arkadiy) - (4)
                                                         Feel free - (jake123) - (3)
                                                             Re: Feel free - (Arkadiy) - (2)
                                                                 You're suggesting that - (jake123) - (1)
                                                                     Basically, yes - (Arkadiy)
                                                     Works here too, both ways. gcc 3.3.2 -NT - (scoenye) - (1)
                                                         It is working here - (jake123)
                         What is the type of 'value1' ? - (jb4) - (1)
                             Nah, it's an int - (jake123)
             NOT better! - (jb4) - (29)
                 Think we've had this argument before - (ChrisR)
                 Agreed -NT - (deSitter)
                 NOT boolean - this is C - (tuberculosis) - (25)
                     Re: NOT boolean - this is C - (deSitter) - (1)
                         Nah, put on your binary thinking cap. :) - (a6l6e6x)
                     Yes, yes...agreed - (jb4) - (22)
                         Breaking bad habits - (ChrisR) - (21)
                             Good points... - (jb4) - (15)
                                 Not that I do a tremendous amount of C programming... - (admin) - (4)
                                     K&R - (ChrisR)
                                     My mileage varies. :-) - (static)
                                     They are all ugly - (tuberculosis) - (1)
                                         Yep. - (admin)
                                 The business seems to have plenty of time on its hands - (ChrisR) - (9)
                                     Disagree with several of your premises - (jb4) - (8)
                                         Dude - (tuberculosis) - (7)
                                             Which reminds me - C++ is why our hardware sucks (new thread) - (tuberculosis)
                                             rofl - (deSitter)
                                             Heh - (jake123)
                                             Dude... - (jb4) - (3)
                                                 Whoa, JB gets feisty! - (deSitter)
                                                 Non-sequitur - (tuberculosis) - (1)
                                                     OK, then apology accepted........;-) - (jb4)
                             I'd have to agree - (jake123) - (4)
                                 Used to be a Fortran thing - (ChrisR) - (3)
                                     Re: Used to be a Fortran thing - (deSitter) - (2)
                                         Yep -FORTRAN for math libs rulez - (tuberculosis) - (1)
                                             Re: Yep -FORTRAN for math libs rulez - (deSitter)
                 Misra C guidelines - (ChrisR)
         Ob-C advice - (deSitter)
         Stylistic tip - (ben_tilly)
         Re: I'm having a problem grokking C - (tuberculosis) - (3)
             Hehehe - (jake123) - (2)
                 int isdigit(int c) { return (c >='0' && c <= '9'); } - (tuberculosis) - (1)
                     :) - (jake123)

It's like dingos mating with elephants: messy loud with lots of snapping and position changes.
139 ms