Bifalgorithm post

So what is dangling pointer and why it's called silent killer in seal plus plus. Let's see that. We have asked for the dynamic memory. We freed that and then you're trying to access that freed space. You're thinking that it is still available or maybe your code is not written properly. But doing this is undefined behavior. So the solution is always and always. Once you delete that, you should always initialize with null pointer or null or zero so that you will know before accessing that it was freed because sometime what happens you just blindly go and try to access and you don't know it was free. Cool right? Thanks for watching.

So what is dangling pointer and why it's called silent killer in seal plus plus. Let's see that. We have asked for the dynamic memory. We freed that and then y…

Ideas in this flowchart

  • Dangling Pointer in C++
  • Definition
  • Dynamic Memory Request
  • Memory Freed
  • Accessing Freed Space
  • Undefined Behavior
  • Solution
  • Initialize with Null
  • Prevent Blind Access
Feed/

So what is dangling pointer and why it's called silent killer in seal plus plus. Let's see that. We have asked for the dynamic memory. We freed that and then you're trying to access that freed space. You're thinking that it is still available or maybe your code is not written properly. But doing this is undefined behavior. So the solution is always and always. Once you delete that, you should always initialize with null pointer or null or zero so that you will know before accessing that it was freed because sometime what happens you just blindly go and try to access and you don't know it was free. Cool right? Thanks for watching.

"So what is dangling pointer"

👍
0
0 comments0 shares

Sign in to view and post comments.