Back to list

Protocol Buffers Builder

Lv.4253@mukitaro0 playsJan 2, 2026

Google Protocol Buffers message building pattern. Common in gRPC services.

preview.cpp
C++
1Person person;
2person.set_name("Alice");
3person.set_id(123);
4person.set_email("alice@example.com");
5auto* phone = person.add_phones();
6phone->set_number("555-1234");
7phone->set_type(Person::MOBILE);
8std::string output;
9person.SerializeToString(&output);

Custom problems are not included in rankings