August 2002
Beginner
1122 pages
22h 1m
English
Suppose that we have the example program in Figure 10.33 (which is contained in the file refcnt1.cpp if you want to print it out).
#include <iostream>
#include <string>
#include "itemp.h"
using namespace std;
int main()
{
StockItem item1("cups",32,129,10,5,"Bob's Dist.",
"2895657951"); // create an undated object
StockItem item2("Hot Chicken",48,158,15,12,"Joe's Dist.",
"987654321", "19960824"); // create a dated object
StockItem item3 = item1; // copy constructor
item1 = item2; // assignment operator
item1.FormattedDisplay(cout); // display an object with labels
return 0;
}
|
This program doesn't do anything ...
Read now
Unlock full access