Validated user input in C++


Validated user input in C++

Validated user input in C++

As a programer sometimes it is necessary, to validate a user entry into a program, there is a ver easy way to do that using if and else, you can also do it with do and while, but my example consists of the first, so I’m going to explain that one.
As you can see I used a string as the correct user name, if the username is not the same as the one I the I gave to the string, it will show “Usuario incorrecto”, that’s how validation works, I hope this was helpful.

CC BY 4.0 Validated user input in C++ by Salvador García is licensed under a Creative Commons Attribution 4.0 International License.

Comments are closed.