answersLogoWhite

0

Before a function can be called the compiler needs to know the function's type and the number and type of its arguments to ensure the call is valid. This information is provided by the function declaration, which must be visible to the compiler prior to the point of the call (a forward declaration). With a two-pass compiler, the declaration may be placed before or after the call point.

Ideally, function declarations should be placed in a header file, with the functions grouped in some logical manner. For instance, all string-handling functions may be declared in a "string.h" header. in this way, the programmer need only include the header to ensure the declarations are consistent across all translation units that require those declarations.

In addition, all types required by the function must also be declared to the compiler. Again, these may be placed in a header to ensure the types are declared consistently.

User Avatar

Wiki User

8y ago

What else can I help you with?

Continue Learning about Engineering

Why you have begin with main function?

You don't have, it's only the program-execution which begins with the main function, but it doesn't have to be the first function in the source-file.


What is the difference between dynamic and static binding?

Static binding is where the linker copies the called function into the program's executable image from the appropriate library and resolves the references to the function at compile/link time. The program contains a copy of the library function and does not need to load it at run time. Dynamic binding is where the linker inserts stub code into the program's executable image that references the appropriate library. The library function is then copied into memory at load or run time and references are resolved then. The program does not contain a copy of the library function, and the library must be accessible at load/run time. There are two kinds of dynamic binding. The first is load time, where the library must be loaded before the program starts to execute. In this case, if the library is not found, load fails and the program does not run. The second is run time, where the library must be loaded at the point of first access. This occurs after then program starts to execute, and the program can change its behavior depending on options or library availability.


What is the Use of main function in c language?

Any program source has to identify a memory location as the start of the program. The OS transfers control to this point of the program or module. In case of C programs, the starting module is NOT your program, but another initialisation routine, which has name lis c0s.obj, c0l.obj etc. This routine after doing initial housekeeping work, like storing program name, arguments, environment variables etc. in the stack, calls a routine by name main. How else are we going to tell the OS where to start ? At the end of executing the main() function, the control goes back to the routine from which the main was called and then to OS, which terminates the program.


How do you write a program to find out the square and cube of first ten natural numbers in gw basic?

First you will need to have some basic programming knowledge. You can use this to help make the program that is needed.


Write a java script program to print first ten odd natural numbers in C?

Q.1 Write a program to print first ten odd natural numbers. Q.2 Write a program to input a number. Print their table. Q.3 Write a function to print a factorial value.

Related Questions

What action is taken by CPU after reset to execute first instruction of program?

The fetch-execute cycle.


Why is it that sometimes when you run a program it will execute the previous program instead the current open program?

because the previous program is the first one to be interpreted that's why you need to re run the program to open the current program that you want to open


What is a main function in c plus plus?

It is the first function that gets called when the program is executed.


How do you make program specification?

you first of all state the function of the program. State the inputs that will be used,the algorithm and the outputs of the program.


What is the first step in the schedule preparation process and what is its end result?

Identify the Tasks; a list of all the tasks required to execute the program.


Why you have begin with main function?

You don't have, it's only the program-execution which begins with the main function, but it doesn't have to be the first function in the source-file.


What is the difference between dynamic and static binding?

Static binding is where the linker copies the called function into the program's executable image from the appropriate library and resolves the references to the function at compile/link time. The program contains a copy of the library function and does not need to load it at run time. Dynamic binding is where the linker inserts stub code into the program's executable image that references the appropriate library. The library function is then copied into memory at load or run time and references are resolved then. The program does not contain a copy of the library function, and the library must be accessible at load/run time. There are two kinds of dynamic binding. The first is load time, where the library must be loaded before the program starts to execute. In this case, if the library is not found, load fails and the program does not run. The second is run time, where the library must be loaded at the point of first access. This occurs after then program starts to execute, and the program can change its behavior depending on options or library availability.


What is the Use of main function in c language?

Any program source has to identify a memory location as the start of the program. The OS transfers control to this point of the program or module. In case of C programs, the starting module is NOT your program, but another initialisation routine, which has name lis c0s.obj, c0l.obj etc. This routine after doing initial housekeeping work, like storing program name, arguments, environment variables etc. in the stack, calls a routine by name main. How else are we going to tell the OS where to start ? At the end of executing the main() function, the control goes back to the routine from which the main was called and then to OS, which terminates the program.


What was the first space program started by nasa?

Mercury was the name of the first American Space program started by NASA. The goals were to see if humans can go to space and function normaly.


What came first the Apollo program or the Gemini program?

The Gemini program came first. It was a precursor to the Apollo program and its main goal was to develop the techniques needed for the Apollo missions to the moon. The Apollo program followed the Gemini program and its main objective was to land humans on the moon and bring them back safely to Earth.


How do you write a program to find out the square and cube of first ten natural numbers in gw basic?

First you will need to have some basic programming knowledge. You can use this to help make the program that is needed.


When first powered on the first instructions a computer will execute are stored in?

The BIOS.