May 2012
Intermediate to advanced
679 pages
16h 56m
English
Most compilers now provide a new class string. It is associated with many useful methods. Instead of using any particular compiler or library based class string, let us develop our own class. So far, we have studied many features of Object oriented programming. This exercise will help us in improving our skills.
To differentiate from other strings, we will call this class STRING. This class will consist of an array of 80 characters to store a string. Ordinary (C-strings) are null terminated. We will not put any such restriction in class STRING. To keep the information about number of characters we will use an integer variable called len. We can show it in Figure 8.2
Let us develop our first STRING program.
Read now
Unlock full access