------------------------------------------------------------------------------
MC logo
PrintMeLots2 Class
[^] Code Examples
------------------------------------------------------------------------------
<<PrintMeLots Class printmult2.h PrintMe Test Driver>>
#ifndef _PRINTMULT2_H_
#define _PRINTMULT2_H_

#include <iostream>

/*
 * This class is constructed with an integer, which it
 * will print repeatedly surrounded by [].
 */
class PrintMeLots2: public PrintMe2 {
    private:
        int count;              // Here is the repeat count.
    public:
        // Remember the number.
        PrintMeLots2(int num, int cnt): PrintMe2(num) { 
                count = cnt;
        }

        // Print the string.
        virtual void print() { 
                for(int m = count; m > 0; m--)
                        PrintMe2::print();
        }
};

#endif
<<PrintMeLots Class PrintMe Test Driver>>