diff options
Diffstat (limited to '2025-linuxdays/constructor.c')
| -rw-r--r-- | 2025-linuxdays/constructor.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/2025-linuxdays/constructor.c b/2025-linuxdays/constructor.c new file mode 100644 index 0000000..08e2b6c --- /dev/null +++ b/2025-linuxdays/constructor.c @@ -0,0 +1,15 @@ +#include <stdio.h> + +[[gnu::constructor]] +static void _our_constructor(void) { + printf("Constructor\n"); +} +[[gnu::destructor]] +static void _our_destructor(void) { + printf("Destructor\n"); +} + +int main(int argc, char *argv[]) { + printf("main\n"); + return 0; +} |
