Showing posts with label Asked in TCS. Show all posts
Showing posts with label Asked in TCS. Show all posts
Sunday, 5 July 2015
Monday, 20 October 2014
Tuesday, 19 August 2014
What are the different Storage Classes in C language
Storage Classes:
Storage Classes specify the characteristic properties of the memory location where memory is allocated for that variable.
--> C Language Provide four types of storage classes as follows.
1) Auto Storage Class
2) Static Storage Class
3) Extern Storage Class
4) Register Storage Class
1)Auto Storage Class:
--> Here memory is allocated and de-allocated automatically based on scope of the variable.
--> When the control enters to the scope, memory is allocated.
--> When the control runs out of the scope, memory is de-allocated automatically.
--> So, scope of an automatic variable will be only for the block in which it is contained and it's time will be only for the execution of that block/function.
Keyword: auto
--> When we don't specify any storage class, then by default is auto.
2)Static Storage Class:
--> It is useful when we are required to retain the values of variables even after coming out of the function.
--> for the static variables, memory is allocated only once when the program starts the execution and will be de-allocated when execution of the program is complete.
--> So, scope of a static variable will be only for the function in which it is contained, where as life time will be throughout the execution of the program.
Keyword : static
--> static variable assume a value of "0"(zero) by default, we can also assign our interested value as required.
3)Extern Storage Class:
--> This is useful when different files in a project are required share/access a common variable.
Keyword: extern
--> Only global variables can be declared as extern variables.
4)Register Storage Class:
--> It is useful when we are required to store the variable specified in a CPU register.
Keyword: register
Subscription
Popular Posts
-
Latest AMCAT practice papers: Download Now AMCAT Exam Pattern 2014 1) Quantitative Ability Section 2) Logical Ability Section ...
-
1) If the word " BOOK " is coded as " CPPL " then how to code the following words? i) MASTER ii) REASON ...
-
amazon is the one of the leading and big online shopping website. Even if it is leading or big online shopping website, it may have some...
-
Operators: The symbol is used to perform an operation is called an operator. --> An operator which expect only one operand is r...
-
Control Statements These statements are useful to decide which statements are executed and which statements are not to be executed ...
-
Functions Functions are introduced by the concept of write once and run any number of times. --> A Function is self contained bl...
-
Glenwood Systems is one of the healthcare software development company. It is established in 1988 Interview Process: 1st Ro...
-
Files --> A file is a defined data type used as data structure. A file is known as a string. --> Files are used to stored data ...
-
Strings A string is a group of characters enclosed in a curly braces or ends with a null character --> The null character is p...
-
Pointers Pointer is a variable which stores address of another variable. --> The syntax for declaring a pointer is as follows...
Categories
- ACT
- ADP
- AMCAT
- Android
- Aptitude
- Array Programs
- Asked in AMCAT
- Asked in Global Edge
- Asked in Infosys
- Asked in Placements
- Asked in TCS
- Asked in Tech Mahindra
- Asked in Virtusa
- Basic I/O and Data Types
- C Language Tutorials
- C Programs
- Coding & Decoding
- Daily Questions
- Essential
- Fony Technologies
- Glenwood Systems
- Huawei
- Java Programs
- Java Script
- Mind Tree
- MiracleSoft
- Offcampus Placements
- Placement Papers
- Placements Questions
- PORTWARE
- Programs
- Search Programs
- Selection Process
- Smartphones
- Sort Algorithms
- String Manipulation Programs
- Structures
- Syntel
- TCS
- TCS Placement Papers
- Tech Tips
- Technical Questions
- Variables and Data Types
- Virtusa
- WhatsApp Features
- WhatsApp Tricks
- WIPRO
Powered by Blogger.

