有人能看到这个错误吗?我得到的错误是:
1>MainForm.cpp(71):error C2059:语法错误:‘)
1>MainForm.cpp(72):error C2143:语法错误:缺失;'{‘之前的’
1>MainForm.cpp(75):错误C2181:如果不匹配,则为非法
1>MainForm.cpp(75):error C2059:语法错误:‘’
1>MainForm.cpp(76):error C2143:语法错误:缺失;'{‘之前的’
代码:
if (oMail->From->ToString()->Contains("email@gmail.com")) //Compare to whitelist
{
mailSend::sendMail("email@gmail.com", "Commands Accepted!", "You are on the whitelist for this server.");
}
else if () //Compare to blacklist
{
mailSend::sendMail("email@gmail.com", "Commands Rejected!", "You are on the blacklist for this server.");
}
else () // Else do Default Behavior
{
if (UserSettings::TheInstance2->defaultBehavior->ToString() == "Accept")
{
mailSend::sendMail("email@gmail.com", "Commands Accepted!", "Accepted");
}
else if (UserSettings::TheInstance2->defaultBehavior->ToString() == "Accept (And add to Whitelist)")
{
mailSend::sendMail("email@gmail.com", "Commands Accepted!", "You have been added to the whitelist for this server!");
}
else if (UserSettings::TheInstance2->defaultBehavior->ToString() == "Reject")
{
mailSend::sendMail("email@gmail.com", "Commands Rejected!", "The server admin has set the server to reject non-whitelisted addresses.");
}
else if (UserSettings::TheInstance2->defaultBehavior->ToString() == "Reject (And add to Blacklist)")
{
mailSend::sendMail("email@gmail.com", "Commands Rejected!", "The server admin has set the server to add rejected addresses to the blacklist. You are now on it.");
}发布于 2011-04-11 00:16:50
你的代码写着:
else if () 这肯定是个错误。
发布于 2011-04-11 00:16:27
else ()
// ^^ Remove this.
{
// ....
}else语句不应该有()
https://stackoverflow.com/questions/5615616
复制相似问题