[Webinar] Streamline your web hosting managementRegister Today

x
?
Solved

cprogramming

Posted on 2000-02-03
8
Medium Priority
?
149 Views
Last Modified: 2010-04-02
can i write a c program without main()
function  in the  program?
0
Comment
Question by:mohua_banerjee
8 Comments
 
LVL 10

Expert Comment

by:rbr
ID: 2488825
Posted twice pls delete.
0
 
LVL 33

Expert Comment

by:hongjun
ID: 2489001
No there must have void main() for all programs.
This is already a standard.
0
 
LVL 10

Expert Comment

by:rbr
ID: 2489018
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.
 
0
Never miss a deadline with monday.com

The revolutionary project management tool is here!   Plan visually with a single glance and make sure your projects get done.

 
LVL 4

Expert Comment

by:pagladasu
ID: 2502949
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
0
 
LVL 33

Expert Comment

by:hongjun
ID: 2504259
I have withdrawn my answer.
Sorry about that.

hongjun
0
 

Accepted Solution

by:
msivari earned 40 total points
ID: 2505510
No. main() function in C or C++ defines Start and End of a proccessing in a program, Then a program whiteout it can't to start.
0
 

Expert Comment

by:MaheshKP
ID: 2507135
i am also supporting to msivari.
Any C program must have to start with
main().With out main() we can't execute the program..
0
 

Author Comment

by:mohua_banerjee
ID: 2508024
i want to close the answer as this is enough.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Unlike C#, C++ doesn't have native support for sealing classes (so they cannot be sub-classed). At the cost of a virtual base class pointer it is possible to implement a pseudo sealing mechanism The trick is to virtually inherit from a base class…
C++ Properties One feature missing from standard C++ that you will find in many other Object Oriented Programming languages is something called a Property (http://www.experts-exchange.com/Programming/Languages/CPP/A_3912-Object-Properties-in-C.ht…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
The viewer will learn how to pass data into a function in C++. This is one step further in using functions. Instead of only printing text onto the console, the function will be able to perform calculations with argumentents given by the user.
Suggested Courses

591 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question