constructor and destructore attributes

This commit is contained in:
Richard Thier 2025-04-24 18:19:47 +02:00
commit 41181c3d04

16
construct_destruct.c Normal file
View File

@ -0,0 +1,16 @@
#include<stdio.h>
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");
}