0
接收到信號我有一個指針,當我取消對它的引用,它給我的錯誤。問題是參數* ns__personRequestResponse段錯誤的gSOAP的,下停止,因爲它從操作系統
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 ;
};
我得到段故障時,我將值分配給整數變量的結果。我如何讓它工作?
它詳細介紹了這個錯誤。錯誤:從「詮釋」到「詮釋*」的無效轉換[-fpermissive] – Kahn
@Hesper:你肯定在結構中的「結果」字段真是聲明爲一個整數?也許你在結構聲明中有一個不必要的'*'....你應該編輯你的問題來包含聲明。 –
我現在已經包含了具有ns1__PersonRequestResponse定義的頭文件的一部分。 star是必須的,因爲它的gsoap返回類型,它應該是一個指針。 – Kahn