C validating user input connaissance dating
NET app, except that you don't have the nice Validation controls. NET background look at how people use Custom Validators - pay attention to the code-behind and ignore the client-side validation. NET comparatively is the existence of custom controls that help do it for you.
Also, you can use Regular Expressions in a Console app just as easily as you can in an ASP. Probably the reason validation isn't mentioned specifically to Console apps is that validation of input is validation of input.
In this case it would be an input that is not an integer.
$ ./Enter a number (0-9) :2 Good Enter a number (0-9) :^[[A Good Enter a number (0-9) : Good Enter a number (0-9) : Good Enter a number (0-9) : Good Enter a number (0-9) : Good Enter a number (0-9) : Good Enter a number (0-9) : Good ^C , and return 0 (indicating no successful assignments). Well, here's an ugly case: suppose your user types in "12w4".If it is a valid number, subtract the character 0 from it.'9' - '0' = 9 (the actual integer 9).I'm trying to validate user input that user must enter number and it must be greater than 0, the validation of only numbers I got it working; however, I can't seem to incorporate the validation of greater than 0 I think that should fix it. I don't know what you had going on in that while condition. Zexanima's version because he's using the assignment operator ('=') instead of the comparator ('==') (or in the case: unequality comparator '!