Hi Can anybody tell me
What is the usage of Static functions and where we can use
what is the advantage of Static functions over Normal functions
Advance Thanks for helping
Hi Can anybody tell me
What is the usage of Static functions and where we can use
what is the advantage of Static functions over Normal functions
Advance Thanks for helping
http://www.daniweb.com/forums/announcement118-2.html
Perhaps show some effort by listing a few cases yourself first.
>What is the usage of Static functions and where we can use
static functions have a visibility restricted to the translation unit in which they're declared. You can use them anywhere a regular function can be used, but you should use them everywhere you can because they follow the rule of minimal scope.
If you have a small program with just one *.c file, then static functions aren't all that useful. The advantage of statics is with larger programs whose projects consist of several *.c files. In this case, as Narue already said, make all the functions static that do not need global scope to other *.c files. And the same with global data objects, make them static too if they don't need to be referenced in more than one *.c file.
Thanks for your helping
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.