C++ verifying user input to txt file | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

C++ verifying user input to txt file

I have an object array holding data from a text file to be used as an address list. I got everything figured out except for verifying that the user input of a last name matches a last in the txt file. E.g. last name smith in text file, user enters Bob, obviously wrong. How do I catch it?

20th Mar 2019, 8:08 PM
Wiz
Wiz - avatar
1 ответ
0
You can verify it with a regular expressions(look it up to know more about it) because this will check if input is equal to what the user typed. Also, you can use loops for iterate each word and verify if they're same
20th Mar 2019, 9:08 PM
Juan David Padilla Diaz
Juan David Padilla Diaz - avatar