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.
20 lines
440 B
C++
20 lines
440 B
C++
5 years ago
|
IntCell.h - IntCell class interface (Fig 1.7)
|
||
|
|
||
|
#ifndef IntCell_H_
|
||
|
#define IntCell_H_
|
||
|
|
||
|
/**
|
||
|
* A class for simulating an integer memory cell.
|
||
|
*/
|
||
|
class IntCell
|
||
|
{
|
||
|
public:
|
||
|
explicit IntCell( int initialValue = 0 );
|
||
|
int read( ) const;
|
||
|
void write( int x );
|
||
|
private:
|
||
|
int storedValue;
|
||
|
};
|
||
|
|
||
|
#endif
|