Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...


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

Explain how can I read and write comma-delimited text?

0 Answers  


how logic is used

0 Answers  


#include<std.h> int main() { char *str[]={"Frogs","Do","Not","Die","They","Croak!"}; printf("%d %d\n",sizeof(str),strlen(str)); ...return 0; } what will the output of the above program?

6 Answers  


which is the best site or book for learning C...and i need the content for C..how to get the good programming skills....? can plz suggest me....

2 Answers  


When should a type cast be used?

0 Answers  


printf(), scanf() these are a) library functions b) userdefined functions c) system functions d) they are not functions

0 Answers  


Is it possible to initialize a variable at the time it was declared?

0 Answers  


Tell me is null always defined as 0(zero)?

0 Answers  


Write a program to reverse a string.

0 Answers   Global Logic, iNautix, TCS, Wipro,


When you call malloc() to allocate memory for a local pointer, do you have to explicitly free() it?

2 Answers   Aloha Technology,


the output will be #include<stdio.h> int main () { int i; i = 9/2; printf("%i",i); return 0; }

4 Answers   CMC, TCS,


What are the scope of static variables?

0 Answers  


Categories