as the title says..
if I create a header file with name MyHeader.h and its corresponding definitions in different file MyFunction.c
or even general case.. I have those function definitions in multiple .c files..
how will the compiler know where the definition of a particular declaration is?
Ex:
MyHeader.h
f1.cCode:#ifndef __MYHEADER_H #define __MYHEADER_H void f1(void); void f2(void); #endif
f2.cCode:void f1(void) { printf("I am f1"); }
test.cCode:void f2(void) { printf("I am f2"); }
how should be the Makefile now?Code:#include "MyHeader.h" int main() { f1(); f2(); return 0; }