I'm currently working on a program that encrypts and decrypts messages. Traditionally, messages in cryptography are displayed in groups of five letters regardless of actual spaces. Something like this:
Code:
THISI SONLY ATEST TESTI NGONE TWOTH REE
I know that I could use a loop to put in those spaces, but what I'd really like to do is write my own iosflag. I'd like to display what I just wrote using code like this:
Code:
cout << setiosflags(ios::crypt)
     << "THISISONLYATESTTESTINGONETWOTHREE";
My teacher said he's never done this and doesn't know how. Does anyone here know the syntax for writing my own iosflag? Your help will be greatly appreciated.