I don't understand what is difference between static and normal function?
eg :
static int gg(){
printf("Hello world\n");
int gg1(){Quote:}
printf("Hello world\n");
--Quote:}
signoff predator
I don't understand what is difference between static and normal function?
eg :
static int gg(){
printf("Hello world\n");
int gg1(){Quote:}
--Quote:}
--
__ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/ \ The woman's movement is no longer a cause but a symptom.
\__/ Joan Didion
Physics reference / http://www.alcyone.com/max/reference/physics/
A physics reference.
HTH, Jens
--
_ _____ _____
_ | | | | | | AG Moebius, Institut fuer Molekuelphysik
| |_| | | | | | Fachbereich Physik, Freie Universitaet Berlin
\___/ens|_|homs|_|oerring Tel: ++49 (0)30 838 - 53394 / FAX: - 56046
--
signoff predator
--
Fletcher Glenn
to reply remove NOSPAM from my reply address
Quote:> I don't understand what is difference between static and normal function?
> eg :
> static int gg(){
> printf("Hello world\n");
> }
> int gg1(){
> printf("Hello world\n");
> }
> --
> signoff predator
But it was pretty clear the original poster wasn't talking about this
C++ meaning of static, anyway.
--
__ San Jose, CA, US / 37 20 N 121 53 W / ICQ16063900 / &tSftDotIotE
/ \ Custom reconciles us to everything.
\__/ Edmund Burke
Alcyone Systems' CatCam / http://www.catcam.com/
What do your pets do all day while you're at work? Find out.
1. static functions in library matching global functions
I have a peculiar problem which I'm sure you gurus can answer.
I've created a full-blown Motif widget for Solaris 2.5.1 and I've compiled
it into a dynamic shared library so that I can use it in multiple programs.
The problem is, however, that some of the static functions in the library
have the same names as public functions in the application that uses the
library, and at runtime the library calls the global functions instead of
its own static functions!
I thought that static stuff were renamed so that it would not be accessible
nor possibly match other functions. If, for instance, a static variables in
two object modules have the same name, how do the compiler know which one to
use, and when? But if functions are renamed, how come the application
manages to call the wrong functions?
Is the behavior perhaps different when compiling a library (I'm using cc
4.2)? Is there a switch I can use to make the library call the correct
static functions?
Please help, as I don't know how to solve this problem (other than the
obvious; renaming the functions, of course (which is not a good solution
since I can never be 100% sure whether some other program has global
functions with the same names...).
--
Ketil Hunn
4. Linux Losers
5. Make gcc3.3 Eliminate Unused Static Functions
7. ixj.c: EXPORT_SYMBOL of static functions
9. objdump -r a.o not giving static function call
10. "static declaration for `function' follows non-static"????
11. How to locate static variables declared inside a function?
12. dlsym/dladdr and functions declared "static"
13. hugetlb: make private functions static