【发布时间】:2015-06-27 02:53:25
【问题描述】:
我不知道如何在 protobuf-c 中表示指针。
当有如下结构时
struct EXAMPLE1
{
int32 x;
int32 *y;
};
如何在 protobuf-c 中表示指针变量 (y)?
message EXAMPLE1
{
int32 x;
?? y;
}
【问题讨论】:
标签: protocol-buffers protobuf-c
我不知道如何在 protobuf-c 中表示指针。
当有如下结构时
struct EXAMPLE1
{
int32 x;
int32 *y;
};
如何在 protobuf-c 中表示指针变量 (y)?
message EXAMPLE1
{
int32 x;
?? y;
}
【问题讨论】:
标签: protocol-buffers protobuf-c
指针值仅在一台计算机和一个正在运行的应用程序中才有意义。协议缓冲区被设计为在不同系统之间进行通信,因此它不包含传输指针的方法。
改为直接将整数放入结构体中,或者找其他方式(数组索引,唯一id)在接收端重构指针。
【讨论】: