Last active
August 29, 2015 14:11
-
-
Save onqtam/1aa3e06ca791aff1a82d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <cstdio> | |
#include <cstring> | |
struct RAII { | |
~RAII() { | |
char buf[1000]; | |
memset(buf, 'A', 1000); | |
} | |
}; | |
void thrower() { | |
char buf[10]; | |
sprintf(buf, "KITTIEEEE"); | |
throw buf; | |
} | |
int main() { | |
try { | |
RAII temp; | |
thrower(); | |
} catch(char* buf) { | |
printf(buf); | |
} | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment