Skip to content

Instantly share code, notes, and snippets.

@jdumont0201
Last active May 5, 2018 07:53
Show Gist options
  • Save jdumont0201/a6e3a9954f04ff727092bed2560d5020 to your computer and use it in GitHub Desktop.
Save jdumont0201/a6e3a9954f04ff727092bed2560d5020 to your computer and use it in GitHub Desktop.
Bad object contruction using new
class A{
int d_val;
public:
A(int val){
d_val=val;
}
};
int main(){
A * a=new A(5);
// ...
// exception might be raised
// ...
delete a;
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment