Name:
Anonymous
2010-11-01 17:23
#include <stdio.h>
enumEXCEPTION_Type {
DivisionByZeroException,
ぬるぽException
}
typedef struct {
enumEXCEPTION_Type type;
char *message;
}EXCEPTION
int main() {
int j=1, i=0;
structEXCEPTION *anus;
//try {
if(j == 0) {
anus = newException(DivisionByZeroException, "OH SHI-");
goto catch;
} else {
i/j;
goto finally;
}
//}
catch:
printf("I DIVIDED BY ZERO: %s", anus->message);
free(anus);
finally:
printf("I'm always executed");
return 0;
}
Name:
Anonymous
2010-11-01 17:53
Optimized:
#include <stdio.h>
enum [b][i][u][o]EXCEPTION[/o][/u][/i][/b]_Type {
DivisionByZero[b][i][u][o]EXCEPTION[/o][/u][/i][/b],
ぬるぽException
}
typedef struct {
enum [b][i][u][o]EXCEPTION[/o][/u][/i][/b]_Type type;
char *message;
}[b][i][u][o]EXCEPTION[/o][/u][/i][/b]
int main() {
int j=1, i=0;
struct [b][i][u][o]EXCEPTION[/o][/u][/i][/b] *anus;
//try {
if(j == 0) {
anus = new[b][i][u][o]EXCEPTION[/o][/u][/i][/b](DivisionByZero[b][i][u][o]EXCEPTION[/o][/u][/i][/b], "OH SHI-");
goto catch;
}
i/j;
goto finally;
//}
catch:
printf("I DIVIDED BY ZERO: %s", anus->message);
free(anus);
finally:
printf("I'm always executed");
return 0;
}