August 2002
Beginner
1122 pages
22h 1m
English
Now that we've disposed of the default constructor, let's take a look at the line in our string interface definition (Figure 7.1 on page 405): string(char* p);.[7] This is the declaration for another constructor; unlike the default constructor we've already examined, this one has an argument, namely, char* p.[8]
[7] I know we've skipped the copy constructor, the assignment operator, and the destructor. Don't worry, we'll get to them later.
[8] There's nothing magical about the name p for a pointer. You could call it George if you wanted to, but it would just confuse people. The letter p is often used for pointers, especially by programmers who can't type, which unfortunately is fairly common.
As we saw in ...
Read now
Unlock full access