S
stub
My understanding is that "MyString" is created within the function of "emit"
on stack. How could the value of "MyString" be returned to the caller
successfully?
string emit()
{
string MyString("This is a string from emit()");
return MyString;
}
int main()
{
string YourString;
YourString = emit();
...
}
on stack. How could the value of "MyString" be returned to the caller
successfully?
string emit()
{
string MyString("This is a string from emit()");
return MyString;
}
int main()
{
string YourString;
YourString = emit();
...
}