我有一个指针,当我取消引用它时,它给了我错误。问题是参数 *ns__personRequestResponse
int __ns3__PersonRequest(soap *, _ns1__PersonRequest *ns1__PersonRequest, _ns1__PersonRequestResponse *ns1__PersonRequestResponse)
{
ns1__PersonRequestResponse->result = 0;
//ns1__PersonRequestResponse = new _ns1__PersonRequestResponse();
*ns1__PersonRequestResponse->result = 39; // Error here
return SOAP_OK;
}
下面是从 wsdl 创建的具有响应参数的头文件的一部分。
class _ns1__PersonRequestResponse
{
public:
/// Element result of type xs:int.
int* result 0; ///< Nullable pointer.
/// A handle to the soap struct that manages this instance (automatically set)
struct soap *soap ;
};
当我为整数变量结果赋值时出现分段错误。我怎样才能让它工作?