C++简答题 新手不会求回答

2025-04-30 05:34:35
推荐回答(1个)
回答1:

貌似很简单啊

前缀和后缀的区别是返回值不同。比如 int a = 2; int c ;
c = a++; c=2 c = ++a; c=3

class A {
public:
friend A operator++(); 全局前缀
friend A opeator++(int); 全局后缀
public:
A operator++(); 成员函数前缀
A opeator++(int); 成员函数后缀
};