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 DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight Arrow Icon

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

View Full DocumentRight 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

This note was uploaded on 09/05/2011 for the course CGS 2421 taught by Professor Onal during the Fall '09 term at University of Florida.

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
Ask a homework question - tutors are online