J
jeniffer
Can a static function defined in a C file be ever referred (called)
externally from another C file?If so in which conditions?
externally from another C file?If so in which conditions?
Can a static function defined in a C file be ever referred (called)
externally from another C file?If so in which conditions?
only when you include the file(in which static function is defined)
in another C file(in which you want to use)
jeniffer said:Can a static function defined in a C file be ever referred (called)
externally from another C file?If so in which conditions?
only when you include the file(in which static function is defined) in
another C file(in which you want to use)
jeniffer said:Can a static function defined in a C file be ever referred (called)
externally from another C file?If so in which conditions?
Vladimir said:(e-mail address removed) opined:
your answer is wrong. Including a file into another makes it a
part of that file, and thus irrelevant to the original question. See
my other post for the correct answer.
No, it's still a separate file but it becomes part of the same
translation unit. The information is correct, but it's not the "only"
way.
Keith said:Is this a homework question?
If you want to call a function from another C file, don't make it
static.
suresh said:This situation is not just academic. Consider a callback function
implementation.
jeniffer said:Can a static function defined in a C file be ever referred (called)
externally from another C file?If so in which conditions?
This is incorrect. A pointer-to-function with external linkage will do
the job.
Want to reply to this thread or ask your own question?
You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.