/* Here I will write down some of my answers and comments for the exercises in C ++ primer 4th (Note: I didn't buy an answer book, so it is not guaranteed that it is correct. What do you think is wrong, I hope you can tell me) the requirements for source code running are the same as those in the book. The pre-compilation and using lines are omitted. If you still don't know what to say, you can ask me, but I am also a beginner and may not know, I know that I am a beginner when I am still studying C ++ Prime. You are welcome to repost it, but please keep the author's name "jiutian Yuling ". */
Int main ()
{
List <char *> pclist;
Char * word1 = "I ";
Char * word2 = "am ";
Char * word3 = "";
Char * word4 = "good ";
Char * word5 = "boy ";
Pclist. push_back (word1 );
Pclist. push_back (word2 );
Pclist. push_back (word3 );
Pclist. push_back (word4 );
Pclist. push_back (word5 );
List <char *>: const_iterator pclfirst = pclist. Begin (), pcllast = pclist. End ();
Cout <"The pclist:" <Endl;
For (; pclfirst! = Pcllast; ++ pclfirst)
{
Cout <* pclfirst <"";
}
Cout <Endl;
Pclfirst = pclist. Begin ();
Vector <string> SVEC;
SVEC. Assign (pclfirst, pcllast );
Cout <"The SVEC:" <Endl;
For (vector <string >:: const_iterator first = SVEC. Begin (), last = SVEC. End ();
First! = Last; ++ first)
{
Cout <* First <"";
}
Cout <Endl;
Return 0;
}