Skip to content
This repository was archived by the owner on Apr 19, 2025. It is now read-only.

Commit 88f9ad3

Browse files
committed
Improve demo
1 parent 41a466a commit 88f9ad3

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

demo.c

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,11 @@ void error_callback( struct cex_status *st, enum cex_error err )
4747
abort( );
4848
}
4949

50+
void foo( )
51+
{
52+
throw( CEX_STRING, "throw from foo()" );
53+
}
54+
5055
int main( )
5156
{
5257
// Initialize CEX
@@ -94,6 +99,15 @@ int main( )
9499
}
95100
}
96101

102+
try
103+
{
104+
foo( );
105+
}
106+
catch catch_case( CEX_STRING )
107+
{
108+
printf( "caught string down here: %s\n", cex_what );
109+
}
110+
97111
// Cleanup
98112
cex_delete( &CEX );
99113
return 0;

0 commit comments

Comments
 (0)