Hello everybody! I’m new to C++. Need some help. I am trying to prompt the user to enter the file name. File itself includes list of 5 emails.
After user enters the file name, program should check the list of emails and output all emails that have wrong email format (each email should have only one “@” character and one dot).
So I need to create 2 functions:
- bool oneAt(char email ); - to check if each email has ONLY one “@” character.
- bool oneDot(char* email); - to check if each email has ONLY one “.” (dot).
It should be really easy, but I just can’t implement it. I hope somebody can help me.
Jump to Post
This version of getline should probably be your tool of choice http://www.cplusplus.com/reference/iostream/istream/getline/
Beyond that, which parts are stumping you? Can you open a file? Can you search through the characters of a string?
All 7 Replies
We're a friendly, industry-focused community of 1.21 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.