Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   Can u dare to answer this (http://www.go4expert.com/forums/dare-answer-t24839/)

Anchal Laller 3Feb2011 13:45

Can u dare to answer this
 
As we know execution starts from main method, is there any procedure to replace this calling by other function
In which file this information is defined??

shabbir 3Feb2011 14:33

Re: Can u dare to answer this
 
Yes you can define your own static variable which calls a function and this way your execution can begin before call to main.

xpi0t0s 4Feb2011 12:29

Re: Can u dare to answer this
 
The call to main is performed in a compiler-specific object file, in at least one compiler I've seen this is called _crt0.o. If you write your own _crt0.c and compile it, you could in theory change the starting function, but there's not a lot of point: just create a main function that calls the function you want to call; it's a lot less work.


All times are GMT +5.5. The time now is 09:03.