I’m currently working on a C++ project involving [sebutkan topiknya, misal: Dynamic Memory/Arrays]. My code compiles, but I keep getting a runtime error (segmentation fault) when trying to execute the function.
I need a tutor to:
- Identify the cause of the memory leak/error.
- Explain the fix clearly so I can avoid this in the future.
- Ensure the code follows best practices (using smart pointers if applicable).
Attached is my current source code.

Leave a Reply
You must be logged in to post a comment.