pr11-16 - cout << "The value is " <<

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
// This program demonstrates the action of // convert constructors. #include "Convert.h" // Function prototypes. void printValue(IntClass); IntClass f(int); int main() { // Initialize with an int. IntClass intObject = 23; cout << "The value is " << intObject.getValue() << endl; // Assign an int. intObject = 24;
Background image of page 1
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: cout << "The value is " << intObject.getValue() << endl; // Pass an int to a function expecting IntClass. cout << "The value is "; printValue(25); cout << endl; // Demonstrate conversion on a return. intObject = f(26); cout << "The value is "; printValue(intObject); return 0; }...
View Full Document

This document was uploaded on 02/08/2012.

Ask a homework question - tutors are online