I have a file name fun.c contain the fuction to add two number (addnum(a,b)).Now I create another file name callfunc.c.Here I want to call the function (addnum(a,b)) from the file fun.c. How can I do that?.

I think that you have to make a header file containing that function.

I would not quote me on this.

You might want to find one of the more advanced C users.

Hope this helps!

Comments
How can it possibly help if you don't know the answer?

I have a file name fun.c contain the fuction to add two number (addnum(a,b)).Now I create another file name callfunc.c.Here I want to call the function (addnum(a,b)) from the file fun.c. How can I do that?.

Create a header file fun.h with a prototype of the function.
Add #include "fun.h" to the beginning of callfunc.c
Compile the two C files together.

Do you realize that in English, when you end a sentence with a . you're supposed to add a space or two so it's easy to understand what you write? That goes for !?, too.

Create the header file func.n and include all the function declarations in this file.
In the other C file, use extern followed by the name of the function.

Comments
I think jep meant to give you the orange!!
sorry. no.

Create the header file func.n and include all the function declarations in this file.
In the other C file, use extern followed by the name of the function.

no, that is entirely incorrect. please do not post wrong answers after someone has already correctly answered the question.

jgehlot, what Walt posted is correct, just do what he said

This article has been dead for over six months. Start a new discussion instead.