zh***********@gmail.com wrote:
"sa*****@yahoo.co.in дµÀ£º
>>
I had a look at a big project for real-world purpose and i found
that all the functions in c have been prototyped as static and i
understand that this would mean that these functions can be called
only from code within that file, please let me know if there are
any other reason to do this.
My gut feeling is that your project are in one single directory and
all the major functions are in one big chunk of code. Static
functions are usually used as what you have indicated in your post.
This shall be the only reason for the other programmers do this.
Please don't top-post. I fixed this one. See the links below.
The fundamental reason is privacy. By declaring the functions
static their names are known only within that compilation unit, and
there is no restriction against reusing the identical names in
another compilation unit. Especially in large projects this avoids
many linking problems.
--
Some informative links:
<news:news.announce.newusers
<http://www.geocities.com/nnqweb/>
<http://www.catb.org/~esr/faqs/smart-questions.html>
<http://www.caliburn.nl/topposting.html>
<http://www.netmeister.org/news/learn2quote.html>
<http://cfaj.freeshell.org/google/>