Home >Backend Development >C++ >What does it mean in c language
static keyword specifies the storage duration and scope of a variable: Storage duration: Global and static local variables exist throughout the program life cycle. Scope: Global static variables are accessible program-wide; local static variables are only visible within the declaring function.
static
The meaning of keyword in C language
static
Keywords are used to specify the storage duration and scope of variables. In C language it has the following meaning:
Storage duration:
static
Key word statement. static
Variables exist throughout the lifetime of the program, even if the scope in which they reside has ended. Scope:
static
Global variables are visible throughout the program. static
Local variables are only visible within the function in which they are declared. Further explanation:
Globalstatic
Variables:
Local static
Variable:
Purpose:
The above is the detailed content of What does it mean in c language. For more information, please follow other related articles on the PHP Chinese website!