Fundamental Programming Memory Management Beginner
Q What is wrong with this C++ function? int* f(){ int x = 5; return &x; }
  • A Memory leak
  • B Compilation error
  • C Nothing; it works correctly
  • D It returns a dangling pointer to a local variable that no longer exists
Leave a Comment