C++ 变量未在此范围内声明
对不起,如果这是一个非常基本的问题。我是一个Java的家伙,是CPP的新手。按照逻辑,我觉得一切都很好。但是编译器仍然抛出错误 “结果未在此范围内声明”原因可能是什么 导致错误的行是C++ 变量未在此范围内声明,c++,C++,对不起,如果这是一个非常基本的问题。我是一个Java的家伙,是CPP的新手。按照逻辑,我觉得一切都很好。但是编译器仍然抛出错误 “结果未在此范围内声明”原因可能是什么 导致错误的行是 ns1__changePinTestResponse* result= soap_new_ns1__ChangePinResponse(this); 这是我的密码 int ATLServerService::changePinTest(_ns1__changePinTest *ns1__changePinTe
ns1__changePinTestResponse* result= soap_new_ns1__ChangePinResponse(this);
这是我的密码
int ATLServerService::changePinTest(_ns1__changePinTest *ns1__changePinTest, _ns1__changePinTestResponse *ns1__changePinTestResponse)
{
LOG_DEBUG_MSG("ATLServerService::changePassword()");
char* accountID = (char*)ns1__changePinTest->accountID.c_str();
int accountPin = ns1__changePinTest->accountPin;
char* newPassword = (char*)ns1__changePinTest->newPassword.c_str();
char* yourSerialNumber = (char*)ns1__changePinTest->yourSerialNumber.c_str();
tfaddress transactionFileAddress;
int returnValue = 0;
returnValue = Account::changePassword(toteGateway, myGdi,accountID, accountPin,
newPassword, yourSerialNumber, &transactionFileAddress);
ns1__changePinTestResponse* result= soap_new_ns1__ChangePinResponse(this);
result->code = returnValue;
if (returnValue == ESUCCESS) {
result->message = &SUCCESS;
result->transactionFileAddress = transactionFileAddress;
} else {
result->message = &ERROR;
}
ns1__changePinTestResponse->changePinTestReturn= result;
return SOAP_OK;
}
缺少第一个下划线。应该是:
_ns1__changePinTestResponse
不是
哪一行导致错误?@VictorPolevoy使用line编辑您忘记了前缀下划线。结构是_ns1 u changepindestresponse。我建议使用更清晰的数据类型名称和声明。在C++代码中,一个主要的下划线丢失了。看起来你仍然是一个非常明显的C++错误消息的牺牲品。
ns1__changePinTestResponse