The static storage class can be applied to both local variables and global variables. The static local variables are accessible only within the function or block in which they are declared, but their lifetime is throughout the program. The static global variables are accessible throughout the file in which they are declared but not in other files. Syntax for declaring static variable is shown below: The four storage classes can be summarized as shown below: The storage classes specify the scope and lifetime of a variable in a C program. The scope (active) specifies in which parts of the program
The post A brief introduction to static storage class in C programming appeared first on Coding Security.
A brief introduction to static storage class in C programming
read more
Tidak ada komentar:
Posting Komentar