KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
I have a class called Object which stores some data. I would like to return it by reference using a function like this: Object& return_Object(); Then, in my code, I would call it like this: Object myObject = return_Object(); I have written code like this and it compiles. However, when I run the code, I consistently get a seg fault. What is the proper way to return a class object by reference?
Tags (comma-separated)
Save Edits
Cancel