I want to call functions defined in test.c from other.c.
Can I extern
the function1
to call it? Also, do I have to use extern
in <
Function declarations are "by-default" extern
.
Quoting C11
, chapter §6.2.2, (emphasis mine)
If the declaration of an identifier for a function has no storage-class specifier, its linkage is determined exactly as if it were declared with the storage-class specifier
extern
. [...]
So, you don't need to be explicit about it.
You need to compile the translation units aka source files (into object files) and then link them together to build the executable. That should do it.