Can a program be written without main()
function?
I have written this code and saved a filename as withoutmain.c
and getting an error as
undefined reference to 'WinMain@16'"
My code
#include<stdio.h>
#include<windows.h>
extern void _exit(register int code);
_start(){
int retval;
retval=myFunc();
_exit(retval);
}
int myFunc(void){
printf("Hiii Pratishtha");
return 0;
}
Please provide me the solution of this problem and also the proper memory construction of code and what is happening at the compiler end of this program. Thank you!