cho rằng để trỏ đến một phần tử của một mảng của các đối tượng của loại T p 1 điểm để các phần tử tiếp theo của T p +1 mà mảng, và p 1 điểm để các phần tử trước đó. Điều này ngụ ý rằng tương đương với sự mâu thuẫn bằng cách sử dụng một con trỏ: | Section A String Class 297 friend bool ope rator const String x const String y return strcmp x. rep- s y. rep- s 0 String operator const String const String String operator const String const char To save space I have left the I O and concatenation operations as exercises. The main program simply exercises the String operators a bit String f String a String b a 2 x char c b 3 cout in f a b c n re turn b int main String x y cout Please enter two strings n cin x y cout input x y n String z x y f x y if x z cout x corrupted n x 0 if x z cout write failed n cout exit x y z n This String lacks many features that you might consider important or even essential. For example it offers no operation of producing a C-string representation of its value 10 Chapter 20 . Advice 1 Define operators primarily to mimic conventional usage . 2 For large operands use const reference argument types . 3 For large results consider optimizing the return . 4 Prefer the default copy operations if appropriate for a class . 5 Redefine or prohibit copying if the default is not appropriate for a type . 6 Prefer member functions over nonmembers for operations that need access to the representation . 7 Prefer nonmember functions over members for operations that do not need access to the representation . 8 Use namespaces to associate helper functions with their class . 9 Use nonmember functions for symmetric operators . 10 Use for subscripting multidimensional arrays . 298 Operator Overloading Chapter 11 11 Make constructors that take a single size argument explicit . 12 For non-specialized uses prefer the standard string Chapter 20 to the result of your own exercises . 13 Be cautious about introducing implicit conversions . 14 Use member functions to express operators that require an lvalue as its left-hand operand . Exercises 1. 2 In the following program which conversions .