Nathan Fig
Nathan Fig

Reputation: 15119

Any way to cout in base64?

I know I could use itoa to create a base64 string, just wondered if there was an easy way to cout a number in base64 the same way cout << hex sets a flag to display integral values in hex...

Upvotes: 2

Views: 667

Answers (2)

Martin Beckett
Martin Beckett

Reputation: 96167

It's an old code but valid xstreambuf

Upvotes: 0

jason
jason

Reputation: 241769

There isn't a built-in way (setbase only accepts 8, 10, 16 as parameters). You'll have to write your own stream manipulator.

Upvotes: 1

Related Questions