answersLogoWhite

0


Best Answer

It does not have to. What is necessary, is that a function be declared before using it, so you either need function declaration separately from definition, or you need to arrange the declaration/definition in the right order, which usually places the main() function last.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Does a function call come before main?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Continue Learning about Engineering

Why we use function prototyping in c language?

You could just define the whole function before it is called, like this:void do_nothing(){}main(){do_nothing();}but if you define the function after it is called, the compiler will arrive at the function's calling before its actual definition. If you prototype your function earlier in the code than the function's call, the compiler will look for the function first.Hope I was able to help.


What is drawback of writing the definitions of all the functions before main function?

If you write out the functions before you write main, you will probably have to return to the functions after outlining main and correct them so that they interact with main as they should. In the long run, it is far better to write main first, so that you understand exactly what you want each function to do before you write the function, so that you don't have to go back and correct them.


Why you have to put empty parathensis after main function?

Empty parenthesis is a self invoked function that is executed immediately after its created. IT makes the function an expression and any subsequent function, the call.


Where does c language program begin execution?

The execution of the program starts with function main, wherever it is in the source.


Why should a function or a variable be declared before its first use?

It is somewhat syntax of programming. But when program runs,device known as pre-processor process statements before main function. So when we use that function inside main function it will get idea and run directly without showing any error. So for compilers simplicity and fast execution purpose it is necessary to declare function before its use.

Related questions

What do you call the little earthquakes that come before a big earthquake?

Foreshock is what you call one of the little earthquakes that come before the big earthquake or main shock. The main shock may be followed by a little earthquake that's called the aftershock.


What is meant by a function call?

A function call is where you "call" a function and execute its body. For example: void example() { } int main() { example(); // call the function "example" and execute its bodyreturn 0; }


Where is the fuction call of main function?

The main function is the entry point into a program. When the Operating System launches the program the main function gets executed.


What do you call the process of testing flow of control between a main function and its subordinate function?

function-call and returning (actually, it is 'passing', not 'testing')


How you write a c program for making a call in gcc?

int main() { // Call the printf function printf("This is a function call!\n"); return 0; }


Why we use function prototyping in c language?

You could just define the whole function before it is called, like this:void do_nothing(){}main(){do_nothing();}but if you define the function after it is called, the compiler will arrive at the function's calling before its actual definition. If you prototype your function earlier in the code than the function's call, the compiler will look for the function first.Hope I was able to help.


What is drawback of writing the definitions of all the functions before main function?

If you write out the functions before you write main, you will probably have to return to the functions after outlining main and correct them so that they interact with main as they should. In the long run, it is far better to write main first, so that you understand exactly what you want each function to do before you write the function, so that you don't have to go back and correct them.


What is the main function of C?

The main function is the entry point for the application. Each program written in C or C++ will start at the first line in the main function, and cease execution once the main function returns control to the operating system (either via a return keyword in the main function, an exit(3) function call, or by "running off" the end of the main function). A program will not compile if it is missing the main function. Some variants of C++ have an alternate entry point (including those written for Microsoft Windows).


Why you have to put empty parathensis after main function?

Empty parenthesis is a self invoked function that is executed immediately after its created. IT makes the function an expression and any subsequent function, the call.


How do you call a function in the main function?

name ( parameters )example:int main (int argc, char **argv){int i;for (i=0; i


Where does c language program begin execution?

The execution of the program starts with function main, wherever it is in the source.


Why should a function or a variable be declared before its first use?

It is somewhat syntax of programming. But when program runs,device known as pre-processor process statements before main function. So when we use that function inside main function it will get idea and run directly without showing any error. So for compilers simplicity and fast execution purpose it is necessary to declare function before its use.