I have a C file (say file1.c
) that calls a function
fun1(1,b)
.
This function fun1(int a,int b)
resides in another C file (say file2.c
) but its prototype is not included in the header file (say file2.h
).
file2.h
is included in file1.c
.
My question is, if I call fun1(a,b)
from file1.c
, will it work by passing control to the function definition in file2.c
? Or will an exception occur or what will be the expected behavior?
Do I have to give a prototype of fun1(int a, int b)
in file2.h
for this to work?
A couple things can happen depending on the situation and your compiler:
You SHOULD provide a prototype regardless.