answersLogoWhite

0

What is the scope of a static function in C?

Updated: 8/17/2019
User Avatar

Wiki User

13y ago

Best Answer

The source file it is in.

User Avatar

Wiki User

13y ago
This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: What is the scope of a static function in C?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

Scope of static variables?

Scope of static variable is with in the file if it is static global. Scope of static variable is with in the function if variable is declared local to a function. But the life time is throughout the program


Why inline function cannot be static?

Inline functions can be static. However, their usage outside of classes in C++ has been deprecated (a hangover from C). Static member functions are allowed of course, and they can be inline expanded where desired. In C, a static function simply has limited scope within the same translation unit. In C++, unnamed namespaces are the preferred method of achieving the same end.


Which is the keyword used to limit the scope of a function to the file in which it resides?

Declare the function static.


Which is the keyword used to limit the scope of the function to the file in which it is reside?

Declare the function static.


What is mean by scope in c language?

Scope is generally defined as variable or functions life... Generally the life is between the opening braces and close braces "{ }" ... If thee variable is defined as "static" and if is defined outside a function then its scope is in same file. if defined as global then its scope is across the files.


What is static char in C?

static storage class in C tells that: The variable will have the default value as zero. The variable scope will be the file in which it is defined. RaVi


Why static variables in a function have global extent?

A variable declared static outside of a function has a scope the of the source file only. It is not a global variable. A variable declared outside of a function and without the static qualifier would be a global variable.


What do you mean by scope of class object in c?

Scope determines the lifetime of non-static names, as well as the visibility of both static and non-static names, when constructors and destructors are called and when member variables are initialised. Names can be applied to any type of variable, including instances of a class (objects).There are five distinct types of scope in C++:Local scope: names declared within a statement block are accessible only to that block and the blocks contained by it, from the point of declaration onwards. This includes the formal names of arguments to a function.Function scope: labels are the only names that have function scope.File scope or namespace scope: any name declared outwith all blocks and classes has file scope. Non-static names are usually referred to as global names.Class scope: Names of private class members have class scope, which includes friends of the class. Names of protected members extend their scope to derivatives of the class. Names of public members extend their scope outwith the class.Prototype scope: Names declared in a function prototype are only visible until the end of the prototype.


What is the difference between normal function and static function in c plus plus?

When a function is declared static at file scope, this means the function has internal linkage only. That is, the function is only accessible to the translation unit in which it is declared. This applies to both C and C++. However, we can achieve the same thing in C++ by declaring a (non-static) function in an un-named (anonymous) namespace. Whether this better represents internal linkage or not is merely a matter of taste. In C++ we can also declare static functions inside a class. Static member functions differ from non-static member functions in that they do not have access to a 'this' pointer; they are local to the class, not to objects (instances) of the class. As such, they can be invoked without having to instantiate an object from the class.


Can you declare an object inside static number function in c?

No, because there are no objects in C.


What is the definition of the term C static?

The term C static is a variable within computer programming in particular C Language. When set static the variable inside a function keeps its value between invocations.


What variable scope is preferable in modules to avoid overwriting existing data?

C: static other: (default)