Posted: Wed Jul 09, 2014 8:35 pm Post subject: RE:[C-tut] WIP - Whirlwind Tour of C
Is this viable in C though? Sure, you could draw up a function that operates on an array to do the same thing, but then things might start to get messy.
Srlancelot39
Posted: Wed Jul 09, 2014 8:49 pm Post subject: Re: [C-tut] WIP - Whirlwind Tour of C
Okay, thanks!
Also though, the following code does not seem to be working for me:
Even when a "valid" character is entered, it still executes the error message. What am I doing wrong?
Tony
Posted: Wed Jul 09, 2014 8:51 pm Post subject: RE:[C-tut] WIP - Whirlwind Tour of C
Depending on specifics, using bitfields might work very well in C. Given that every option is represented by a unique bit, then you can OR a bunch of options to create a "set" and AND against that "set" to check for inclusion.