Validating in c

) -- Eric Sosman es*****@acm-dot-org.invalid It's an optimization. ) I don't think it would be fair to reveal the source of the source, so to speak.I usually don't ask people for this sort of help for assignments, as some see it as unfair, however, I am totally lost on this subject.Thanks once again, kind regards, Gurdip validation, but actually, this question was raised because of my Data Structures and Algorithms lecturer.She didn't teach us nuts aboutvalidation, and she comes to class saying that we all have to do "datavalidation for input". contains no alphabetic characters), and the bet is greater than zero and the bet is less than or equal to the house limit and the bet is an integer and the bet is less than or equal to the player's bank balance, then the bet amount is valid.

validating in c-68validating in c-35

For #2, you can just do to discard as many characters in the input stream as possible until it reaches a newline character (from the user pressing Enter).

Consider, for example, an input of a bet amount for a roulette game. Reminder: a great way to cheat at poorly-written gambling programs is to bet a negative amount, using the house advantage against it, then try to "lose".

Consider, for example, an input which is a telephone number. Hint: isdigit(buffer[0]) returns 0 if the first character in buffer[] is not a digit, and nonzero if it is.

She didn't teach us nuts about validation, and she comes to class saying that we all have to do "data validation for input". contains no alphabetic characters), and the bet is greater than zero and the bet is less than or equal to the house limit and the bet is an integer and the bet is less than or equal to the player's bank balance, then the bet amount is valid.

Note that this code requires modification when a new non-USA area code is assigned. User inputs: 12145551212 Extension 234 Well, I'm sorry if I got each and every person confused about datavalidation, but actually, this question was raised because of my Data Structures and Algorithms lecturer.

Leave a Reply