sbmoon <sb****@dreamwiz.com> scribbled the following:
Is there any difference between two functions defined below ?
static int my_func() ;
int my_func() ;
Thanks in advance!
Your friendly C textbook should have already explained this.
A static function has a name visible in that translation unit only. A
normal function has a name visible across the entire program.
If you were to have two source files:
static int foo() {
return 0;
}
int bar() {
return 0;
}
(both files look the same)
you would get "function already defined" errors for bar, but foo would
compile absolutely OK.
--
/-- Joona Palaste (pa*****@cc.helsinki.fi) ---------------------------\
| Kingpriest of "The Flying Lemon Tree" G++ FR FW+ M- #108 D+ ADA N+++|
|
http://www.helsinki.fi/~palaste W++ B OP+ |
\----------------------------------------- Finland rules! ------------/
"War! Huh! Good God, y'all! What is it good for? We asked Mayor Quimby."
- Kent Brockman