A function is a member of a class. There is no set_field() function if
field is repeated. Take a look at
https://developers.google.com/protocol-buffers/docs/cpptutorial --
there's add_field() and mutable_field() depending on what you want to
do.

  -ilia

On Sat, Sep 7, 2013 at 1:38 PM, Austin Luu <austinlu...@gmail.com> wrote:
> Hi,
>
> I have a message class:
>
> message Foo {
> repeated Foo2 field = 1;
> }
> (Foo2 is another message)
>
> and in my cpp file:
>
> Foo* ci1;
> Foo* ci2;
> //call some function to to assign values to ci1->field(0)
> function( ci1 )
> //try to copy ci1-field(0) to ci2->field(0)
> ci2->set_field( 0, ci1->field(0) );
>
> But I get an error message:
> error: 'Foo' has no member named 'set_field'
> Why is it reading set_field as a member instead of the function set_ the
> member field?
> I'm new to protocol buffers so any help will be appreciated!
>
> Thanks!
>
> --
> You received this message because you are subscribed to the Google Groups
> "Protocol Buffers" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to protobuf+unsubscr...@googlegroups.com.
> To post to this group, send email to protobuf@googlegroups.com.
> Visit this group at http://groups.google.com/group/protobuf.
> For more options, visit https://groups.google.com/groups/opt_out.

-- 
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to protobuf+unsubscr...@googlegroups.com.
To post to this group, send email to protobuf@googlegroups.com.
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to