Wyo C++
Ch. 13 Worksheet #1
Name -

Use the apstring class to answer the following questions:

  1. How many constructors are included in the class?

  2. How many accessor functions are included there?

  3. List the operators that are overloaded in the apstring class. List them in the order that they appear in the apstring.h header file. (Do not repeat any operators twice.)
  4. What is the return type of eachh of the following functions and operators. (Disregard the const modifier.)

  5. The find member function?

  6. The substr member function?

  7. The overloaded += operator?

  8. The overloaded = operator?
  9. How many parameters are passed to each of the following member functions?

  10. find

  11. substr

  12. length

  13. What is the formal parameter name for the apstring class constructor that constructs an apstring from a string literal?

  14. List the comparison operators that can be used with apstring objects as free functions. List them in the order that they appear in the apstring.h header file but do not list any twice.

  15. What is the difference between a class member function and a free function?


  16. What is the return type of the overloaded <= operator?

  17. What is the return type of the overloaded + operator?

  18. What is the return type of the overloaded << operator?

  19. What is the return type of the accessor member function c_str?

  20. How is this return type different from a simple char? Explain (based on the purpose of c_str) why its return type must be the answer you wrote in #17 and not simply a char.