Case Study: A String Class

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




























Figure 1: 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 2: String class definition with operator overloading. (part 2 of 2)
\includegraphics[scale=0.45]{figures/img8.40.ps}
Figure 3: 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 4: 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 5: 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 6: 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 7: 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 8: 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 9: 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 10: String class test program, output. (part 2 of 2)
\includegraphics[scale=0.45]{figures/img8.55.ps}
2004-07-15