Visual c++ 返回值不正确

Visual c++ 返回值不正确,visual-c++,email-validation,Visual C++,Email Validation,我正在使用这个功能 int spc_email_isvalid(const char *address) { int count = 0; const char *c, *domain; static char *rfc822_specials = "()<>@,;:\\\"[]"; /* first we validate the name portion (name@domain) */ for (c = address; *c; c++) { if (*

我正在使用这个功能

int spc_email_isvalid(const char *address) {


int        count = 0;
const char *c, *domain;
static char *rfc822_specials = "()<>@,;:\\\"[]";

/* first we validate the name portion (name@domain) */
for (c = address;  *c;  c++) {
if (*c == '\"' && (c == address || *(c - 1) == '.' || *(c - 1) == 
    '\"')) {
  while (*++c) {
    if (*c == '\"') break;
    if (*c == '\\' && (*++c == ' ')) continue;
    if (*c <= ' ' || *c >= 127) return 0;
  }
  if (!*c++) return 0;
  if (*c == '@') break;
  if (*c != '.') return 0;
  continue;
}
if (*c == '@') break;
if (*c <= ' ' || *c >= 127) return 0;
if (strchr(rfc822_specials, *c)) return 0;
}
if (c == address || *(c - 1) == '.') return 0;

/* next we validate the domain portion (name@domain) */
if (!*(domain = ++c)) return 0;
do {
if (*c == '.') {
  if (c == domain || *(c - 1) == '.') return 0;
  count++;
}
if (*c <= ' ' || *c >= 127) return 0;
if (strchr(rfc822_specials, *c)) return 0;
} while (*++c);

return (count >= 1);
}
int-spc\u-email\u有效(常量字符*地址){
整数计数=0;
常量字符*c,*域;
静态字符*rfc822_specials=“()@,;:\\\\”[];
/*首先,我们验证名称部分(name@domain) */
for(c=地址;*c;c++){
如果(*c=='\''&&(c==地址| |*(c-1)='.| |*(c-1)=
'\"')) {
而(*++c){
如果(*c=='\“')中断;
如果(*c=='\\'&(*++c=='')继续;
如果(*c=127),则返回0;
}
如果(!*c++)返回0;
如果(*c=='@')中断;
如果(*c!='),则返回0;
继续;
}
如果(*c=='@')中断;
如果(*c=127),则返回0;
if(strchr(rfc822_specials,*c))返回0;
}
如果(c==地址| |*(c-1)='.')返回0;
/*接下来,我们验证域部分(name@domain) */
if(!*(domain=++c))返回0;
做{
如果(*c=='。){
如果(c==domain | |*(c-1)='.')返回0;
计数++;
}
如果(*c=127),则返回0;
if(strchr(rfc822_specials,*c))返回0;
}而(*++c);
返回(计数>=1);
}
当我打开所有功能时,AfxMessageBox(spc_email_)是有效的(“abcd@hot.com")); 它返回空值


如何根据电子邮件id获取值o或1作为第一个参数:

CString str;     
str.Format( _T("%d"), spc_email_isvalid("abcd@hot.com")); 

AfxMessageBox( str, MB_OK | MB_ICONINFORMATION );

使用调试器怎么样?