Search unanswered questions...
Enter a question here...
Search: All sources Community Q&A Reference topics

Difference Main functions and user defined functions?

main function in C programming language and almost in every other main language is the main function that launched after the program starts. It takes two arguments, pointer to pointers array (arguments) and number of arguments.

If you would write your own functions and link by telling the entry point to your program you would not be able to get arguments any more. There are some code running before actually main function is launched. That code prepares the argument data for main function.

But it is possible to change main function to your defined function, but that would require more knowledge of how linker (ld) and for example objcopy utility works.

Note: There might be a difference in GNU and Microsoft C/C++ versions.

Improve Answer Discuss the question "Difference Main functions and user defined functions?" Click here to register and get updates when this answer is edited. Share on Facebook Share on Twitter

First answer by David.lt. Last edit by David.lt. Contributor trust: 15 [recommend contributor]. Question popularity: 2 [recommend question].

Answers.com > Wiki Answers > Categories > Technology > Computers > Computer Programming > Difference Main functions and user defined functions?

Our contributors said this page should be displayed for the questions below. (Where do these come from)
If any of these are not a genuine rephrasing of the question, please help out and edit these alternates.
Two main functions of the ear?  Two main functions in a c program?  5 main muscles and their functions?  What are the main functions of udp?  Which are the main functions stores?  What are the main business functions?  What are the different Ctrl functions?  Main functions of 5 sections of spine?  Whatare the main functions ofWindows XP?  What are the difference functions of music?  What do the main functions protect agianst?  User defined functions and library functions?  What are the main functions of a living tree?  What are the main functions of broadcast media?  Why 'main' is called user defined function in c?  What are the 3 main functions of the wagner act?  What is the main functions of the in sack of sqids?  Main function system define or user define function?  What are the five main functions of the skeleto sytem?  Differences related to user defined functions in C language?