{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Chapter11 - Dr Serdar Kirli 1 Chapter 11 A Simple String...

Info iconThis preview shows pages 1–8. Sign up to view the full content.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: Dr. Serdar Kirli 1 Chapter 11 A Simple String Object ezString Class: Big Picture #include <iostream> #include <cstdlib> #include <string> using namespace std; class ezString { private : char * strPtr; unsigned len; public : ezString(); ezString( const char * s); ezString(ezString & s); ~ezString( void ); unsigned length( void ) const { return len; } ezString & operator += ( const ezString & s); ezString & operator = ( const ezString & s); friend ezString operator + ( const ezString & s1, const ezString & s2); friend ostream & operator << (ostream & st, const ezString & s); }; #include <iostream> #include <cstdlib> #include <string> using namespace std; class ezString { private : char * strPtr; unsigned len; public : ezString(); ezString( const char * s); ezString(ezString & s); ~ezString( void ); unsigned length( void ) const { return len; } ezString & operator += ( const ezString & s); ezString & operator = ( const ezString & s); friend ezString operator + ( const ezString & s1, const ezString & s2); friend ostream & operator << (ostream & st, const ezString & s); }; Constructors ezString Class: Big Picture #include <iostream> #include <cstdlib> #include <string> using namespace std; class ezString { private : char * strPtr; unsigned len; public : ezString(); ezString( const char * s); ezString(ezString & s); ~ezString( void ); unsigned length( void ) const { return len; } ezString & operator += ( const ezString & s); ezString & operator = ( const ezString & s); friend ezString operator + ( const ezString & s1, const ezString & s2); friend ostream & operator << (ostream & st, const ezString & s); }; Destructor ezString Class: Big Picture #include <iostream> #include <cstdlib> #include <string> using namespace std; class ezString { private : char * strPtr; unsigned len; public : ezString(); ezString( const char * s); ezString(ezString & s); ~ezString( void ); unsigned length( void ) const { return len; } ezString & operator += ( const ezString & s); ezString & operator = ( const ezString & s); friend ezString operator + ( const ezString & s1, const ezString & s2); friend ostream & operator << (ostream & st, const ezString & s); }; Member Functions Friend Functions ezString Class: Big Picture #include <iostream> #include <cstdlib> #include <string> using namespace std; class ezString { private : char * strPtr; unsigned len; public : ezString(); ezString( const char * s); ezString(ezString & s); ~ezString( void ); unsigned length( void ) const { return len; } ezString & operator += ( const ezString & s); ezString & operator = ( const ezString & s); friend ezString operator + ( const ezString & s1, const ezString & s2); friend ostream & operator << (ostream & st, const ezString & s); }; Operator Overloads ezString Class: Big Picture #include <iostream> #include <cstdlib> #include <string> using namespace std; class ezString { private : char * strPtr; unsigned len; public : ezString(); ezString( const char * s); ezString(ezString & s); ~ezString( void...
View Full Document

{[ snackBarMessage ]}

Page1 / 130

Chapter11 - Dr Serdar Kirli 1 Chapter 11 A Simple String...

This preview shows document pages 1 - 8. Sign up to view the full document.

View Full Document Right Arrow Icon bookmark
Ask a homework question - tutors are online