answersLogoWhite

0


Best Answer

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 the first element of a 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.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Difference Main functions and user defined functions?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Is the main function in C a built-in function or user-defined function?

The main function in C is user-defined. Built-in functions are simply those that do not require a library to be included, but every program must provide a user-defined point of entry; it cannot be built-in. Indeed, most functions in C are user-defined; the built-in functions are mostly operators rather than functions although most do behave like functions. The standard library functions are not built-in either; they all require the inclusion of the appropriate standard library header.


What is use of user defined data in c?

to create user defined functions the user defined data is needed nd its useful to the programmer to create its own data.


How switch function differs from user defined functions in C?

. please give me 3 or 4 differences.one difference is that user defined can be called anytime but not for switch There is no such thing as 'switch function'


What is the difference between Built in Function and User Defined Function?

Built-in functions are functions that are provided for you by the standard includes. User-defined functions are those that you write yourself. Third-party functions are those that are written for you, but that are not provided by the standard includes.


Is a header file a collection of built in functions that help in writing c programs?

No. There are no built-in functions in C, there are only built-in types and built-in operators for those types. All functions are user-defined, including those defined by the C standard library. There are no user-defined operators in C, but you can implement operators as named functions if required. A header file (*.h file) typically contains a group of related user-defined function and/or user-defined type declarations which can be included in any source file that requires them. Every user-defined function or user-defined type name used by a program must have one (and only one) definition, usually contained in a corresponding source file (*.c file) or library file (*.lib file). Built-in types and their corresponding operators do not require a header file since they are part of the language itself (hence they are built-in).

Related questions

What are user-defined functions?

User-defined functions are functions that are not provided by the language itself. They are the functions that you yourself write or that are provided for you by a third-party.


What is the difference between pre defined functions and user defined functions?

Predefined functions are functions that have been written and we can use them in our C++ statements. But we must know how to use each of these predefined functions.


Is the main function in C a built-in function or user-defined function?

The main function in C is user-defined. Built-in functions are simply those that do not require a library to be included, but every program must provide a user-defined point of entry; it cannot be built-in. Indeed, most functions in C are user-defined; the built-in functions are mostly operators rather than functions although most do behave like functions. The standard library functions are not built-in either; they all require the inclusion of the appropriate standard library header.


What is the difference between predefined functions and user defined functions?

What is the difference between predefined function and user defined functions


In c programming is main predefined or user defined?

main is predeclared and user defined.


What Difference between built-in function and user define function?

Built-in functions are functions that are provided for you by the standard includes. User-defined functions are those that you write yourself. Third-party functions are those that are written for you, but that are not provided by the standard includes.


What is use of user defined data in c?

to create user defined functions the user defined data is needed nd its useful to the programmer to create its own data.


How switch function differs from user defined functions in C?

. please give me 3 or 4 differences.one difference is that user defined can be called anytime but not for switch There is no such thing as 'switch function'


Which is used to create and debug user-defined functions?

Editor and debugger.


What is the difference built in functions and user defined functions?

There are two types of functions in C++: Built-in or standard Library Function User defined function BUILT-IN FUNTION Built-in function which are also called Standard Library Functions are the functions provided by the C++ and we do not have to write them. These functions are included in the Header Files They are mostly written at the start of the Program They cannot be changed. EXAMPLE: conio.h; clrscrn; , etc. USER-DEFINED FUNCTION A user-defined function is a function defined by the programmer. It allows the programmer to write their own function. It allows the programmer to divide the program in many parts, which makes it easy for the programmer to rectify or modify the program; as it is easy to locate & jump to any part of the program. A programmer can write groups code to perform a specific task and that group of code is given a name (identifier).


What is header file in computer programming?

A header file is used in some languages to declare functions that will be used but are not yet defined in the current source code. This is primarily used by C and C++, and usually for library functions and user-defined functions that are stored in separate files and folders than the main source code file.


What does the word computer application mean?

It is a software or program designed to allow a user to perform a veriety of coordinated user defined functions