programming-examples/c++/Others/Fig01_11.cpp - Dynamically allocating an IntCell object (lame).cpp

17 lines
366 B
C++
Raw Normal View History

2019-11-15 12:59:38 +01:00
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;
}