Bruce Eckel's Thinking in C++, 2nd Ed Contents | Prev | Next

answers:

  1. 1. Describe the effects of the three access specifiers
  2. 2. At what point in the compile-edit-link-run cycle is it determined whether access is legal or not?
  3. 3. What effect do access specifiers have on run-time behavior?
  4. 4. What effect do access specifiers have on the physical layout of an object?
  5. 5. What is the difference between a class and a struct?
  6. 6. What is the difference in meaning between the terms data hiding and encapsulation?
  7. 7. How does encapsulation help your programming? What are the safety issues?
  8. 8. If class is so similar to struct, why was the new keyword created?
  9. 9. What does friend mean?
  10. 10. Suppose you want to introduce a structure name without its full body. How do you do this?
A: This is done with a name declaration . For the Stash, a name declaration would be struct Stash;

  1. Create a class using the “Cheshire cat” technique which represents an encryption algorithm that you want to hide as much as possible. The pointer that’s in the handle class should point to an object that contains a member function which is the encryption algorithm, so that function should take a string object and produce an “encrypted” string. Use a trivial encryption algorithm, such as adding one to each letter.
Contents | Prev | Next


Contact: webmaster@codeguru.com
CodeGuru - the website for developers.
[an error occurred while processing this directive]