brokendreams
brokendreams

Reputation: 877

Representing pointer variables in protobuf-c

I am not sure how to represent pointers in protobuf-c.

When there is a structure like the following

struct EXAMPLE1
{
    int32 x;
    int32 *y;
}; 

how would I represent the pointer variable (y) in protobuf-c?

message EXAMPLE1
{    
    int32 x;
    ??  y;
}

Upvotes: 6

Views: 8098

Answers (1)

jpa
jpa

Reputation: 12156

Pointer values make sense only within one computer and one running application. Protocol buffers is designed to communicate between separate systems, therefore it does not contain a method to transfer pointers.

Instead, put the integer directly in the structure, or find some other way (array index, unique id) to reconstruct the pointer on the receiving end.

Upvotes: 5

Related Questions