MaheshKP
asked on
Static funtions
Hi
Please explain me abt Static functions in C...
Static variables which hold the values
with in the program,,But what is use with Static functions..
Is there static functions are available in C.. Ans is Yes then give me syntax and use of that functions with examples...
Thanks in advance
Mahesh
Please explain me abt Static functions in C...
Static variables which hold the values
with in the program,,But what is use with Static functions..
Is there static functions are available in C.. Ans is Yes then give me syntax and use of that functions with examples...
Thanks in advance
Mahesh
static functions can only be used in the .c module in which they are defined, they are not visible in other modules.
ASKER
Hi Rao
What ur telling is Static functions are available in C , Just like static
variables..My understand is correct means give me a ex..
What ur telling is Static functions are available in C , Just like static
variables..My understand is correct means give me a ex..
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Actually, I'm not even sure they are avavilable in ANSI C (I do mostly C++) but GCC thinks it is.
MaheshKP!
In C language static functions are used for code hiding: static functions defined in the module are visible in that module *only*, i.e. linker can't see they though any other "ordinary" function is visible for linker.
So static functions are useful in multimodule projects.
Andrew
In C language static functions are used for code hiding: static functions defined in the module are visible in that module *only*, i.e. linker can't see they though any other "ordinary" function is visible for linker.
So static functions are useful in multimodule projects.
Andrew
Example? just at the static keyword:
static void f()
{
/*Ur code */
}
That's what I said, can only be used from the same module, isn't it?
static void f()
{
/*Ur code */
}
That's what I said, can only be used from the same module, isn't it?
KangaRoo, you are right.
Andrew
Andrew
ASKER
ThanQ for all
Mahesh
Mahesh