MC logo
PrintMe Class
[^] CSc 220 Home
[Introduction] [Boolean and Control] [Functions] [Arrays and Pointers] [Dynamic Arrays] [Array Errors] [Command Array] [Standard Containers] [Structs and Classes] [Automatic Pointer] [Multi-File Programs] [Copying Objects] [Templates] [Inheritance] [Plain C I/O] [Type Odds And Ends] [Plain C Strings] [File I/O]
[Bounded Safe Array] [Bounded Safe Array Driver] [PrintMe Class] [PrintMe2 Class] [PrintMeLots Class] [PrintMeLots2 Class] [PrintMe Test Driver] [Linked List Node Classes] [Linked List Classes] [Linked List Implementation] [Linked List Driver] [Expression Calculator]
#ifndef _PRINTME_H_
#define _PRINTME_H_

#include <iostream>
using std::cout;

 * This class is constructed with an integer, which it
 * will print surrounded by [].
class PrintMe {
        int num;                // Here is the number.
        // Remember the number.
        PrintMe(int m) { num = m; }

        // Print the string.
        void print() { cout << "[" << num << "]"; }