Initial commit

This commit is contained in:
Michael Reber
2019-11-15 12:59:38 +01:00
parent 40a414d210
commit b880c3ccde
6814 changed files with 379441 additions and 0 deletions
@@ -0,0 +1,28 @@
TestMemoryCell.cpp - MemoryCell test program (Fig 1.22)
#include <iostream.h>
#include "MemoryCell.h"
#include "mystring.h"
// OOPS: I forgot to put a + operator in the string class.
// So it's here:
string operator+( const string & lhs, const string & rhs )
{
string result = lhs;
return result += rhs;
}
int main( )
{
MemoryCell<int> m1;
MemoryCell<string> m2( "hello" );
m1.write( 37 );
m2.write( m2.read( ) + " world" );
cout << m1.read( ) << endl << m2.read( ) << endl;
return 0;
}