I have defined two structs in different files with the same name using the keyword "static". This means they should only be visible within those files.
void function()
in one of those files uses one of them.
If I declare extern void function()
in the other, which struct will it use? The one where function()
is defined, or the one where the extern
function is used?
static
doesn't do anything for struct definitions. It only relates to variable and function definitions. Best solution: use different names for your two structs. – The Photon Sep 12 at 15:52extern void foo();
is the same asvoid foo();
because the linkage for functions isextern
by default. – Eugene Sh. Sep 12 at 16:51