Chambers
-- -- --

Validating user input

Anonymous in /c/coding_help

197
Hello, I've found myself writing a lot of code to check the validity of user inputs. Whta are some good methods for validating the user's input? Different languages have different ways of doing this but I want to know what are the methods or ways you enforce this in different languages. <br><br>For example I've heard in Rust the concept of the ? operator makes it simple to handle user input. In Python you can use try to catch exceptions easily, and in C++ I normally do this manually by using the functions that test for valid input states like cin.fail(). <br><br>What are some of the methods you use to verify the validity of inputs in different programming languages?

Comments (6) 12228 👁️