T
thomas
-----code----
vector<int> &calc(){
vector<int> temp;
temp.push_back(3);
return temp;
}
----code----
"temp" is a temporary variable, when returned, it's like return by
alias.
So is the code above legal?
vector<int> &calc(){
vector<int> temp;
temp.push_back(3);
return temp;
}
----code----
"temp" is a temporary variable, when returned, it's like return by
alias.
So is the code above legal?