Exercises

  1. What would happen if we compiled the program in Figure 7.19? Why?

    Figure 7.19. Exercise 1 (code\strex1.cc)

  2. What would happen if we compiled the program in Figure 7.20? Why?

    Figure 7.20. Exercise 2 (code\strex2.cc)

  3. What would happen if we compiled the program in Figure 7.21? Why?

    Figure 7.21. Exercise 3 (code\strex3.cc)

  4. What would happen if a user of our string class wrote an expression that tried to set a string variable to itself ...

Get Learning to Program in C++ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.