Case Study: A String Class

The programs of Figs. 3.12-3.21 demonstrates the building of our own String class to handle the creation and manipulation of strings.




























Figure 3.12: String class definition with operator overloading. (part 1 of 2)
\includegraphics[scale=0.45]{figures/img8.38.ps}
\includegraphics[scale=0.45]{figures/img8.39.ps}
Figure 3.13: String class definition with operator overloading. (part 2 of 2)
\includegraphics[scale=0.45]{figures/img8.40.ps}
Figure 3.14: String class member-function and friend-function definition. (part 1 of 4)
\includegraphics[scale=0.45]{figures/img8.41.ps}
\includegraphics[scale=0.45]{figures/img8.42.ps}
Figure 3.15: String class member-function and friend-function definition. (part 2 of 4)
\includegraphics[scale=0.45]{figures/img8.43.ps}
\includegraphics[scale=0.45]{figures/img8.44.ps}
Figure 3.16: String class member-function and friend-function definition. (part 3 of 4)
\includegraphics[scale=0.45]{figures/img8.45.ps}
\includegraphics[scale=0.45]{figures/img8.46.ps}
Figure 3.17: String class member-function and friend-function definition. (part 4 of 4)
\includegraphics[scale=0.45]{figures/img8.47.ps}
\includegraphics[scale=0.45]{figures/img8.48.ps}
Figure 3.18: String class test program. (part 1 of 2)
\includegraphics[scale=0.45]{figures/img8.49.ps}
\includegraphics[scale=0.45]{figures/img8.50.ps}
Figure 3.19: String class test program. (part 2 of 2)
\includegraphics[scale=0.45]{figures/img8.51.ps}
\includegraphics[scale=0.45]{figures/img8.52.ps}
Figure 3.20: String class test program, output. (part 1 of 2)
\includegraphics[scale=0.45]{figures/img8.53.ps}
\includegraphics[scale=0.45]{figures/img8.54.ps}
Figure 3.21: String class test program, output. (part 2 of 2)
\includegraphics[scale=0.45]{figures/img8.55.ps}
2004-07-29