GSOAP动态数组作为输入参数
gSOAP dynamic array as input parameter
i使用GSOAP工具包生成肥皂服务和客户端,该工具包应该发送一个int数组,该数组被放入结构中,如GSOAP文档中所建议的:
//myservice.h
struct abc {
int __size;
int *__myptr;
};
int ns__SetConfiguration(struct abc as, int* result);
这是我生成代码的方式:
soapcpp2 -i -SC myservice.h
然后从客户端我调用服务:
int result;
int *aa = (int*)soap_malloc(&service, 10*sizeof(int));
abc myabc;
myabc.__myptr = aa;
myabc.__size = 10;
service.setConfiguration(myabc, &result);
但是,在服务方面, size 变为零。我想念什么?
谢谢。
错误。
结构应像这样定义:
struct abc {
int *__ptr;
int __size;
};
相关文章:
- 将输入参数作为右值引用传递?
- 是否可以在命令行中将输入参数传递给可执行文件
- C++基于输入参数的动态代码生成
- 我想知道为什么"std::unique_ptr<int> foo(新 int)"是合法的,因为"std::<int>unique_ptr"要求输入参数类型应该是"int"?
- 如何使用输入参数作为文件的传递?
- 在函数中使用运算符重载,在 c++ 中使用 const 类型输入参数
- 提供变量作为 MATLAB 系统命令的输入参数,以便C++可执行文件
- 函数的函数无法识别输入参数
- 当迭代器(输入参数)通常不是constexpr时,constexpr算法真的有用吗
- 如何将一个使用参数包和typename的类作为函数(c++)的输入参数
- CvMat:输入参数的大小不匹配
- 在什么情况下,使用'const T*'输入参数比'const T&'更可取?
- std::具有两个输入参数的矢量构造函数
- GoogleMock:如何根据另一个输入参数设置ArgReferee?
- 模板化函数以从输入参数推断返回类型 stl-container
- GoogleMock:如何验证输入参数的调用次数?
- 当我将 char 数组发送到输入参数为字符串的函数时会发生什么?
- 应该接受不同输入参数的纯虚函数 - 应该如何实现
- C++主函数的输入参数
- STD :: Atomic_fetch为什么将指针作为其输入参数