answersLogoWhite

0

Why we use function prototyping in c language?

Updated: 11/23/2022
User Avatar

Manishccpp

Lvl 1
13y ago

Best Answer

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.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: Why we use function prototyping in c language?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Why you use 'integer' before function in C language?

To specify the return-type of the function.


What function is used to perform exponentiation in C language?

You can use the pow() function in math.h.


Is prototyping mandatory in c?

Prototyping is optional in C, though highly recommended.


Why you use else function in c language?

You cannot have a function named else, because it is a reserved word.


How you can convert from string to int in C language?

Use the atoi() or atol() function.


What is the use of gets function in c language?

Nothing, it is a security hole. Use 'fgets' instead.


What is the differnce between ordinary function and template function of c language?

The c language does not have template functions. That is a c++ thing.


Why you are using clrscr in c language?

Function 'clrscr' is not part of the C language. Or the standard libraries. It is MS-DOS specific function, use the help for details (clrscr means clear the screen).


Why use setcolor function in c graphics?

C language doesn't say anything about graphics, it is platform-dependent.


How do you use cosine in c language?

Include the header file math.h and use the function acos(d)


How do you createe a file using c language?

Use function open or creat or fopen.


How can you make a file in c language read only?

In UNIX: use function chmod