问题
填空题
表达式x.operator+(y.operator++(0))还可以写成______。
答案
参考答案:x+y++ 或x+(y++)
解析: 此题考查的是运算符重载。y.operator++(0)部分是调用的“++”运算符的重载函数,因此多了一个虚拟参数,所以应该是重载的后缀,划y++,而不是++y。x.operator+(y.operator++(0))表示的就是x+(y++)。
表达式x.operator+(y.operator++(0))还可以写成______。
参考答案:x+y++ 或x+(y++)
解析: 此题考查的是运算符重载。y.operator++(0)部分是调用的“++”运算符的重载函数,因此多了一个虚拟参数,所以应该是重载的后缀,划y++,而不是++y。x.operator+(y.operator++(0))表示的就是x+(y++)。
Fill in the blanks with the given words. 用所给的单词填空。 | |
1. Canada is ______ of . 2. has beautiful . 3. This is a of the world. 4. Beijing is the____city of . is in Beijing. 5. is east of China. is in New York.
|