This code will not compile because we cannot return owner as non owner.
To fix we need to add qualifier owner at return type.
FILE* owner open_file(const char* p) {
FILE* owner f = …
return f;
}
Then when returning f , f is moved. Because f was moved the compiler will not complain at the end of scope of f.https://thradams.com/cake/playground.html?code=I2luY2x1ZGUgP...