Hi all,

I am using google protocol buffer to transmit complex data structures over 
socket. Here is the .proto file:

message MatrixMsg
{
required string msgType = 1;
optional int64 count = 2;
optional string extraInfo = 3;
 message TaskMsg
{
required string taskId = 1;
required string user = 2;
required string dir = 3;
required string cmd = 4;
required int64 dataLength = 5; 
}
 repeated TaskMsg tasks = 4;
}

I serialized a MatrixMsg to string through SerializeAsString(), and the 
string length is 500. Now, I want to convert the string to char* in order 
to send it through socket. However, when I converted to char* through 
string.c_str(), the string got truncated. I printed out the string, and 
figured out there are white space in it. How do I get a char* that is 
exactly matches the string? Thanks!

Ke

-- 
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 [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/protobuf.
For more options, visit https://groups.google.com/d/optout.

Reply via email to