Link to home
Start Free TrialLog in
Avatar of mohua_banerjee
mohua_banerjee

asked on

cprogramming

can i write a c program without main()
function  in the  program?
Avatar of rbr
rbr

Posted twice pls delete.
No there must have void main() for all programs.
This is already a standard.
Even I wrote already that this question was posted twice you give an answer. And the answer is wrong too.
Sure one can write a C programm without any main function. The only change is taht you can't execute such a program directly. But for linking, building libraries, unsing as an external module ... it can be used.
 
rbr is right. you can compile a C program without the main() function. however, you will defineitely give a linking error when you try to create an executible from it.

pagladasu
I have withdrawn my answer.
Sorry about that.

hongjun
ASKER CERTIFIED SOLUTION
Avatar of msivari
msivari

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
i am also supporting to msivari.
Any C program must have to start with
main().With out main() we can't execute the program..
Avatar of mohua_banerjee

ASKER

i want to close the answer as this is enough.