Skip to content

Instantly share code, notes, and snippets.

@kasramp

kasramp/test.cpp Secret

Created August 1, 2020 23:15
Show Gist options
  • Save kasramp/bbeca599d59623e247ef233321b219b5 to your computer and use it in GitHub Desktop.
Save kasramp/bbeca599d59623e247ef233321b219b5 to your computer and use it in GitHub Desktop.
void some_func() {
Point p1 = Point(0, 0);
// p1 is automatically freed
}
void some_func2() {
Point *p1 = new Point(0, 0);
delete p1;
// there's a memory leak unless p1 gets deleted
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment