You are here:

C/main function

Advertisement


Question
can i run a program in c without main if yes how?
if no why

Answer
Answer is "NO".
The reason is, main() is a function called by another function, which is the start-routine. This routine is created by the compiler and will be same for all the programs that you write.
If you can write your own compiler, then you can think of changing main() to your name itself!
ANSI compliant compilers need main() as the starting point.

-ssnkumar

C

All Answers


Answers by Expert:


Ask Experts

Volunteer


Narendra

Expertise

I can answer questions in C related to programming, data structures, pointers and file manipulation. I use Solaris for doing C code and if you have questions related to C programming on Solaris, I will be able to help better.

Experience

6.5

Organizations belong to
Sun Microsystems

Awards and Honors
Brain Bench Certified Expert C programmer.
Advanced System Software Certified

©2012 About.com, a part of The New York Times Company. All rights reserved.