How are you initializing the listOfCapacityTypes pointer?

On Mon, Dec 1, 2008 at 5:02 PM, Grohotanie <[EMAIL PROTECTED]> wrote:

>
> When I use the following code with protobuff listOfCapacityTypes:
>
>  int dataFile = open("capacityTypes", O_RDONLY);
>  taskingElement_sim::CapacityTypes listOfCapacityTypes;
>  google::protobuf::io::ZeroCopyInputStream* fileInput = new
> google::protobuf::io::FileInputStream(dataFile);
>
>  if (!google::protobuf::TextFormat::Parse(fileInput,
> &listOfCapacityTypes)) ...
>
> It works fine, but when I tried to move this code to a separate
> function and declare listOfCapacityTypes to be a pointer so I can
> return it, it segfaults when it gets to the if statement
>
>  if (!google::protobuf::TextFormat::Parse(fileInput,
> listOfCapacityTypes)) ...
>
> I tried to cast it as a pointer to base class Message, but it did not
> help..
> Can anyone help?
>
> Thank you!
> Anton Krivin
> >
>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Protocol Buffers" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/protobuf?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to