What am I missing or doing wrong? Thank you!
simple.proto:
syntax = "proto2";
message repField {
required float x = 1;
required float y = 2;
required float z = 3;
}
message SimpleMessage {
required float lucky_number = 1;
repeated repField vector = 2;
}
simple.options:
SimpleMessage.vector max_count:300
simple.c:
-----
SimpleMessage message = SimpleMessage_init_zero;
pb_ostream_t stream = pb_ostream_from_buffer(buffer, sizeof(buffer));
message.lucky_number = 234.567;
for(i=0;i<300;i++){
message.vector[i].x = i;
message.vector[i].y = i;
message.vector[i].z = i;
}
status = pb_encode(&stream, SimpleMessage_fields, &message);
Thanks! It worked. I also found the fixed_count parameter. The documentation was a bit unclear for me and therefore I got confused.
I am sorry if I annoyed you by posting the same question on stackoverflow (https://stackoverflow.com/q/56739667/2506817) but I have a friend that wanted to help me and posted my message there as well.
I appreciate that you took your time to reply and if you are willing I can ask my friend to delete the other post.
Nicolae.