Storage Class Specifier
Storage Class Specifier
stack:
it is part of RAM
managed by cpu during program execution
it stores :
• function calls
• function arguements
• local variables
• return addresses
cpu registers:
• they are small ,high speed memory location,in processor ,that is used to
store temporary data
• accessing data from register is much more faster than accessing it from
ram
• it speeds up the execution
Output:
Register
• it is used retain the value of variable across the function calls and
restricts its scope inside file only,
• what is meaning of retain :when we say retain means the value is not
lost when function which was created ends.
• the function's variable remembers the last value it stored
storage area:data segment
scope: it depends on where it is declared if it is declared in function it has
fucntion scope
outside function: file scope
when a program runs it uses the memory that is divided into
• code segment,
• data segment,
• heap
• stack
the memory is allocated at program startup and takes throughout program
execution
data segment :
Output: