Since i couldnt find any good c++-forum and many here probably now it, i have a question.
What is wrong with the code below?
I know it\'s something with the for-loop. It\'s suppose to check if there\'s only 1 \"@\", and if there\'s more than 1 it should type out \"Address may only contain 1\".
CString iText;
UpdateData(TRUE);
iText = m_MailAddress;
if (iText.Left(1) == \"@\")
m_MessageToUser = \"Address started with @\";
else if (iText.Right(1) == \"@\")
m_MessageToUser = \"Address ended with @\";
else if
int number=0;
for(int i=0;i<iText.length();i++){
if(iText.at(i)==\'@\')number++;
}
m_MessageToUser = \"Address may only contain 1 @\";
else
m_MessageToUser = \"Address is OK\";
UpdateData(FALSE);
}