You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
17 lines
366 B
C++
17 lines
366 B
C++
5 years ago
|
Fig01_11.cpp - Dynamically allocating an IntCell object (lame)
|
||
|
|
||
|
#include <iostream.h>
|
||
|
#include "IntCell.h"
|
||
|
|
||
|
int main( )
|
||
|
{
|
||
|
/* 1*/ IntCell *m;
|
||
|
|
||
|
/* 2*/ m = new IntCell( 0 );
|
||
|
/* 3*/ m->write( 5 );
|
||
|
/* 4*/ cout << "Cell contents: " << m->read( ) << endl;
|
||
|
|
||
|
/* 5*/ delete m;
|
||
|
/* 6*/ return 0;
|
||
|
}
|