最贊回答 / 慕慕5299279
Class &operator=(const Class& 別名);?這是賦值運算符重載的標準格式,形參為本類對象的常引用,返回值是本類對象自己的引用可以做左值,只能用類的成員重載--回答源于:Class &operator=(const Class &); 操作符重載什么意思???_百度知道 (baidu.com)我的理解就是:Buffer & Buffer :: operator = (const Buffer & buf)Buffer&表示左值...
2023-02-18
最新回答 / 慕桂英5594736
==號即為數學上的等于,而=號在c++中是賦值號,即把右邊的值賦給左邊。例如:a=2;即將2的值賦給a變量,而a==2,多用于判斷a是否等于2
2022-12-12
int* func() {
int* p = (int*)malloc(20 * sizeof(int));
assert(p);
for (int i = 0; i < 20; i++) {
*p = 60 + i;
p++;
}
return p-20;
}
int* p = (int*)malloc(20 * sizeof(int));
assert(p);
for (int i = 0; i < 20; i++) {
*p = 60 + i;
p++;
}
return p-20;
}
2022-12-11