Follow Our FB Page << CircleMedia.in >> for Daily Laughter. We Post Funny, Viral, Comedy Videos, Memes, Vines...


What are Storage Classes in C ?

Answers were Sorted based on User's Feedback



What are Storage Classes in C ?..

Answer / nagalakshmanarao

storage classes in c defines the scope and lifetime of variables.the storage classes are important only in multifunction and multiple file programms.
storage classes are 4 types:they are 1:auto
2:static
3:extern
4:register

Is This Answer Correct ?    0 Yes 0 No

What are Storage Classes in C ?..

Answer / mustaffa hasan

Auto,Static,Extern,Register.Auto are Local variables known
only to the function in which it is declared.Default is
auto.Static are Local variable which exits and retains its
value even after the control is transferred to the calling
function.Global are Global variables known to all functions
in the file.Register are Local variable which is stored in
register.

Is This Answer Correct ?    0 Yes 1 No

What are Storage Classes in C ?..

Answer / sujitpatel

there are 4 types of classes
1 extern
2 static
3 register
4 auto
auto is default storage class which is used as for the
default value . if something s written int a ; then its
default storage is called auto . whereas the scope of the
stATIC and register is for only a file .there is only a
difference that register is used for cpu and static is used
for main memory . the scope of the extern is global it is
used for the whole program .

Is This Answer Correct ?    0 Yes 1 No

What are Storage Classes in C ?..

Answer / vijay r15

storage class is an
attribute that changes
the behaviour of a
variable

There r 4types of
storage classes.They
are
auto
static
extern
register

auto- auto is the
default var type.
ex int x=1 and auto
int x=1 both r same

static- static
variable is a
variable,with in the
scope when it reaches
the initialization it
blindly igores and
hold the updated value

register-reg var tells
the compiler that the
variable will be
heavily used.It is
stored in cpu register

extern- extern var
tells that they have
allocated space in
some other program.
But just using here.
We cant initialize
using extern

with thanks and
regards,
vijay r15,
raj.Vijay55@gmail.Com

Is This Answer Correct ?    2 Yes 4 No

What are Storage Classes in C ?..

Answer / veda

example of global variable----

#include<stdio.h>

int a; /***global variable*********/

void main()
{
int s;
printf("\n enter the value of a--");
scanf("%d",&a);
s=a+3;
printf("\n s=%d",a);

mul(); /****another function********/

getch();


void mul()
{
int m;

m=a*2;

printf("\n m=%d",a);
}


output---
enter the value of a----5

s=8

m=10


when u r compaing this program in lnux we get a waring
because in linux default type is integer so in calling
function we r giving void so internally compailer treate as
a int so,
here type declaration is impartent

Is This Answer Correct ?    21 Yes 25 No

What are Storage Classes in C ?..

Answer / mayank

COMMAND LINE ARGUMENT IN C:::
THE ARGUMENT THAT WE PASS ON TO MAIN() AT THE COMMAND PROMPT
ARE CALLED COMMAND LINE ARGUMENT .........

Is This Answer Correct ?    6 Yes 13 No

What are Storage Classes in C ?..

Answer / mustaffa hasan

what are file reading and coping

Is This Answer Correct ?    1 Yes 11 No

What are Storage Classes in C ?..

Answer / a

a

Is This Answer Correct ?    2 Yes 20 No

What are Storage Classes in C ?..

Answer / shweta

write short note on command line arguments?

Is This Answer Correct ?    15 Yes 38 No

What are Storage Classes in C ?..

Answer / k.anil kumar

AUTO IS A DEFAULT SPECIFIER.THERE IS NO NECESSARY TO
MENTION IT.STATIC FOR LOCAL ANG GLOBAL IS DIFFERENT.STATIC
LOCAL REMAINS KNOWN ONLY TO THE BLOCK WN WHICH IT IS
DECLARED.STATIC GLOBAL IS KNOWN ONLY TO THE FILE.IT IS NOT
SUBJECTED TO ANY SIDE EFFECTS.EXTERN IS JUST A DECLARATION
BUT NOT DEFINITION.FOR INTEGERS AND CHARACTERS , THIS
TYPICALLY MEANS IN THE REGISTER OF THE CPU RATHER THAN IN
MEMORY,WHERE NORMAL VARIABLES ARE STORED.

Is This Answer Correct ?    27 Yes 68 No

Post New Answer



More C Interview Questions

write a program for the normal snake games find in most of the mobiles.

0 Answers   Accenture, Wipro,


what do structure language means?

3 Answers   Microsoft,


Find Error if any in below code, Justify ur answer: struct xx { int a; struct yy { char c; struct xx* p; } struct yy* q; }

3 Answers   NDS,


How can I find the modification date and time of a file?

0 Answers  


can anyone suggest some site name..where i can get some good data structure puzzles???

0 Answers  






What is dangling pointer in c?

0 Answers  


Given a valid 24 hour format time find the combination of the value and write a program ,do not hard the value and if any other inputs provided should work with the logic implemented Input: 11:30 Output: 13:10 Input: 18:25 Output: 21:58

0 Answers   Zoho,


Why is c platform dependent?

0 Answers  


Explain what are the advantages and disadvantages of a heap?

0 Answers  


Expand the following LKB BKL FFG

0 Answers  


Write the program for displaying the ten most frequent words in a file such that your program should be efficient in all complexity measures.

3 Answers   Google,


Find greatest number out of 10 number without using loop.

5 Answers   TCS,






Categories