answersLogoWhite

0


Best Answer

Storage classes are used to indicate duration and scope of a variable or identifier. Duration indicates the life span of a variable. Scope indicates the visibility of the variable. The static storage class is used to declare an identifier that is a local variable either to a function or a file and that exists and retains its value after control passes from where it was declared. This storage class has a duration that is permanent. A variable declared of this class retains its value from one call of the function to the next. The scope is local. A variable is known only by the function it is declared within or if declared globally in a file, it is known or seen only by the functions within that file. This storage class guarantees that declaration of the variable also initializes the variable to zero or all bits off. The extern storage class is used to declare a global variable that will be known to the functions in a file and capable of being known to all functions in a program. This storage class has a duration that is permanent. Any variable of this class retains its value until changed by another assignment. The scope is global. A variable can be known or seen by all functions within a program.

User Avatar

Wiki User

โˆ™ 2006-08-08 06:21:53
This answer is:
User Avatar
Study guides

Data Science

โžก๏ธ
See all cards
4.75
โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…โ˜†โ˜…
4 Reviews

Add your answer:

Earn +20 pts
Q: What is the difference between static and extern?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What is the difference between extern global variable and static global variable in c?

extern variables are defined in different than the file where the main() is. extern variables can be accessed from other files. Static global variables are visible only within the file.


What is difference between declaration and initialization in C programming?

Variable-declaration is: extern int x; extern double y; extern char a; Variable-definition is: int x; static double y; auto char a; Variable-definition with initialization is: int x = 1; static double y= 2.3; auto char a = 'w';


Auto static extern register?

Storage classes.


What are the storage class in c?

It are static, auto and extern.


Can you use extern and static together?

no they cant ... static says ... hey my var is within file scope. extern says .. var is defined some where else .... static var definition cant be seen by other file via their translation tables.... SO extern with static is an erroneous combination sujay0987@yahoo.com


What is the application of static and extern storage classes in C?

There are four storage classes in ca) autob) registerc) staticd) extern


What is the Difference between public static void and static public void?

There is no difference between public static void and static public void


What is the difference between Static IP and Public IP?

difference between static ip and public ip


WAP to show the difference between a variable and static variable?

difference between constant and static variables in java


How i useStatic extern int a in c?

No such thing, pick one ot the three: static int x; extern int x; int x;


What is static extern variables in C?

In c static and global variables are stored in data segment ( which is a special memory in RAM)


What is the difference between complex permittivity and static dielectric conatant?

What is the difference between complex permittivity and static dielectric conatant?

People also asked