commit 41181c3d04fb3e753e902e389f708b17f370b3d4 Author: Richard Thier Date: Thu Apr 24 18:19:47 2025 +0200 constructor and destructore attributes diff --git a/construct_destruct.c b/construct_destruct.c new file mode 100644 index 0000000..6914a2c --- /dev/null +++ b/construct_destruct.c @@ -0,0 +1,16 @@ +#include + +void __attribute__((constructor)) calledFirst(); +void __attribute__((destructor)) calledLast(); + +void main() { + printf("\nI am in main"); +} + +void calledFirst() { + printf("\nI am called first"); +} + +void calledLast() { + printf("\nI am called last\n"); +}