May I ask what's wrong with using xxd? I don't have an opinion about C, but C++ is already pretty complicated, and adding features to the language when there are already well-known solutions doesn't seem wise.
(For the record, I'm aware that there are size limitation when using xxd, but there are also other solutions).