C++ Primer Answer Book
C++ has proven to be a popular programming language, and C++ Primer has proven to be just as popular among those wishing to learn the language. Learning a programming language, however, requires more than just reading about the language constructs. You must program, write your own code, and study code written by those who are more experienced with the use of the language.To this end, Lippman and Lajoie (L&L;) have provided exercises throughout C++ Primer to encourage their readers to test their understanding of the material. Our book provides the solutions to those exercises.C++ Primer Answer Book is intended to be used in conjunction with C++ Primer. We assume that you have read the material in L&L; preceding each exercise. We present our solution along with an explanation, but we do not repeat the material found in L&L.; Only those concepts and constructs that have already been introduced are used in the solutions.When the solution involves a complete program, we generally include the entire source code so that each solution stands on its own. All programs have been compiled using Microsoft Visual C++ Version 5.0. In some instances when the compiler did not meet the standard, a workaround was used and an explanation given.   We recommend that you use L&L; to learn C++, work the exercises, and study the solutions presented here. We hope C++ Primer Answer Book will aid you in understanding C++ while eliminating the frustration of being stuck without an answer to a problem.  AcknowledgmentsSpecial thanks go to Stan Lippman and Josée Lajoie for having the faith to allow us to write this answer book and for their careful review of the text.Sean Davey, Steve Edwards, S. Rollins Guild, Cay Horstmann, and Jeffrey Oldham provided many helpful comments on the manuscript.Clovis thanks George Edmunds, Sam Hsu, Mohammad Ilyas, Mahesh Neelakanta, and Cyril Párkányi for their continued support; Sean Davey for the C++ review, for the LaTeX macros, and for his technical support; Andrew Nathanson for his friendship and software/hardware support; S. Rollins Guild for the C++ review and his friendship; A. Carlos Tondo, Julia Mistrello, and Luiz and Elizabete T. Biavatti for helping our company succeed; and Caren E. Tondo for her love, patience, and sense of humor.Bruce thanks Andrew Bellezza, Jodi Solomon, and Mary Walstrom for their friendship and encouragement; Zahira Ammarguellat, Luddy Harrison, Sandra Loosemore, and Cotton Seed -- one couldn't ask for better co-workers; and Misty and Buddy for their boundless patience.Last, but certainly not least, we thank the staff at Addison-Wesley. We are especially grateful to our associate editor, Debbie Lafferty, for her patience and knowing when and how hard to push; the production editor, Maureen Willard, for guiding us through the editing, proofs, and final pages; the production manager, John Fuller, for getting the macros approved and improved early in the process; and the freelancer, Diane Freed, for assisting with the production of this book. We appreciate your kind help.   Clovis L. TondoBruce P. Leung0201309939P04062001