I was just trying a few things out, as I am just starting with C++. I don't get the following error statement:
#include <string>
using namespace std;
string& s6(string a) {return a;}
int main() {
string a = "helloo";
s6(a);
return 0;
}
Then I get the following warning:
Untitled.cpp:4:30: warning: reference to stack memory associated with local variable 'a' returned [-Wreturn-stack-address] string& s6(string a) {return a;} ^ 1 warning generated.
What does this exactly mean?