@click_here
When we start to write c-program we write some startup code before main function such as headers, Preprocessor. In the following example Delay.h and definition are called before main() function.
Let me make one thing clear that this code will not compile and run, it is just an example to understand. It's puzzle for me I don't understand What happens in a c program before main is called
When we start to write c-program we write some startup code before main function such as headers, Preprocessor. In the following example Delay.h and definition are called before main() function.
C:
#include<device.h>
#include"Delay.h"
#define Switch_Open 0
#define Switch_Close 1
#define Light_ON 1
#define Light_OFF 0
int main()
{
Light = Light_OFF;
Switch = Switch_Open;
if (Switch == Switch_Close)
Light = Light_ON;
Delay(500);
Light = Light_OFF;
return 0;
}
Last edited: