File:  [WindowsNT SDKs] / mstools / samples / iostutor / exios203.cpp
Revision 1.1.1.1 (vendor branch): download - view: text, annotated - select for diffs
Thu Aug 9 18:21:48 2018 UTC (7 years, 9 months ago) by root
Branches: msft, MAIN
CVS tags: ntsdk-oct-1992, ntsdk-nov-1993, ntsdk-jul-1993, HEAD
Microsoft Windows NT Build 328 10-12-1992

// exios203.cpp
// 2-argument manipulator example
#include <iostream.h>
#include <iomanip.h>

struct fillpair {
       char ch;
       int  cch;
};

IOMANIPdeclare( fillpair );

ostream& fp( ostream& os, fillpair pair )
{
    for ( int c = 0; c < pair.cch; c++ ) {
        os << pair.ch;
    }
    return os;
}

OMANIP(fillpair) fill( char ch, int cch )
{
    fillpair pair;

    pair.cch = cch;
    pair.ch  = ch;
    return OMANIP (fillpair)( fp, pair );
}


void main()
{
    cout << "10 dots coming" << fill( '.', 10 ) << "done" << endl;
}

unix.superglobalmegacorp.com

This archive runs on limited infrastructure. Preserving old code on modern bandwidth. Automated agents are requested to crawl responsibly.