A
aarklon
Hi all,
recently i read the following passage in a book
it is a compiler dependent thing if some feature is available that
allows you to execute some function before main() is called.
In turbo C compiler, there's one such fearture....the #pragma startup
directive.
I m giving an example of its use:-
#include<stdio.h>
void fun();
#pragma startup fun
int main()
{
printf("Arun");
}
void fun()
{
printf("Anand \n");
}
The o/p of the program given above will be :- Anand
my question is there a standard way in ANSI-C
to execute a different function before main() is called....??????
recently i read the following passage in a book
it is a compiler dependent thing if some feature is available that
allows you to execute some function before main() is called.
In turbo C compiler, there's one such fearture....the #pragma startup
directive.
I m giving an example of its use:-
#include<stdio.h>
void fun();
#pragma startup fun
int main()
{
printf("Arun");
}
void fun()
{
printf("Anand \n");
}
The o/p of the program given above will be :- Anand
my question is there a standard way in ANSI-C
to execute a different function before main() is called....??????