LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 10-26-2003, 07:59 AM   #1
linuxanswer
Member
 
Registered: Oct 2003
Distribution: woodY 3.0 stable
Posts: 61

Rep: Reputation: 15
more main()?


it's possible to have in a code more function main()?
-Yes?
-No?
--Why?
 
Old 10-26-2003, 08:03 AM   #2
Hko
Senior Member
 
Registered: Aug 2002
Location: Groningen, The Netherlands
Distribution: Debian
Posts: 2,536

Rep: Reputation: 110Reputation: 110
Hardly. If your project consists of more than one different processes, you'll obviously need 1 main() for each program. Also, the kernel has more than one main(). At least each module has it's own main(). [FIXME: not really sure if this really correct]
 
Old 10-26-2003, 01:01 PM   #3
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
modules have no main function, they merely register a set of capabilities with the kernel. the funtions that it registers are then called asynchronously when the events the are registered for occur. (sorry u asked )
 
Old 10-26-2003, 03:06 PM   #4
Mara
Moderator
 
Registered: Feb 2002
Location: Grenoble
Distribution: Debian
Posts: 9,696

Rep: Reputation: 232Reputation: 232Reputation: 232
One main per executable. If you have more executables in your project, you'll have more main() functions.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Greetings from Main g_trueblood LinuxQuestions.org Member Intro 1 09-15-2005 01:20 PM
./main to main DDD26 Linux - Newbie 3 07-25-2005 03:09 PM
(2) Main Menu's? Isn't it, "there can be only one?" for the term "Main"? t3gah LQ Suggestions & Feedback 1 04-09-2005 09:30 AM
main() confusioning in C name_in_use450 Programming 6 07-27-2004 11:27 PM
help with main.cf gruger Linux - Software 3 06-20-2003 06:43 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 11:09 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration