Is there a simple way to initialize a proto message with empty fields in C++?
Example:
Message:
message CardInfo {
string name = 1;
uint32 amount = 2;
}
Print:
CardInfo {
name: "",
amount: 0
}
Protobufs are initialized with default values. Strings are empty and ints are 0.
Note, however, that default values might not be printed.
Try this:
CardInfo info;
std::cout << info.DebugString();