Declaring function as static
|
Ambitious contributor
|
|
| 22Jan2008,10:47 | #1 |
|
If i declare a function as static what will happen
|
|
Contributor
|
|
| 22Jan2008,11:37 | #2 |
|
for static functions in C++ go through:
http://www.codersource.net/cpp_tutor...functions.html and in C 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 with the undermentioned code: Code:
static int fun() {
return 0;
}
int morefun() {
return 0;
}
a static function can only be called in the translation unit in which it is defined... hence a call to a static function from a file where it has not been defined will give a compilation error. friend why don't you try a bit of googling before u post a question..these kind of information is very very easily available on the net. |
