i am currently working on a program that validates email addresses.
i have finished the code to open the user file and read every line in the file and processes every characater to check if there is one "@" and a "." then prints to the console.
i am now having trouble eliminating duplicate emails.
here is the code ive got so far.
string Emails;
char hasat = '@.';
int i;
while (getline(fin, Emails))
{
for (i = 0; i < Emails.length(); i++)
{
if (Emails == hasat)
{
cout << Emails << "; " << endl;
} // if
} // for
} // while
input text file:
randy@comcast.net
john@yahoo.com
apple@hotmail.com
dude@hotmail.com
BIGLETTERS@EMAIL.COM
manyahoo.com
email1@ymail.com
email2@live.com
email_3@yahoo.com
emailinvalid@yahoocom
randy@comcast.net