Created
December 2, 2016 17:51
-
-
Save Gaurav-Singh-97/2202490f2eb887713249fdccb65c2e6a to your computer and use it in GitHub Desktop.
Running functions before and after main() (doesn't work on gcc and g++)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include<stdio.h> | |
void First(); | |
void Last(); | |
#pragma startup First | |
#pragma exit Last | |
void First() | |
{ | |
printf("B4 main\n"); | |
} | |
void Last() | |
{ | |
printf("After main\n"); | |
} | |
int main() | |
{ | |
printf("Inside main\n"); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment