what is the difference between auto and static keywords



what is the difference between auto and static keywords..

Answer / dr. guruprasad

auto and static are both storage classes.
if a variable is declared as auto - then the life of it will be only till function block.
if static - then value persists between various function call. Life till program ends.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

What are examples of structures?

0 Answers  


study the code: #include<stdio.h> void main() { const int a=100; int *p; p=&a; (*p)++; printf("a=%dn(*p)=%dn",a,*p); } What is printed? A)100,101 B)100,100 C)101,101 D)None of the above

15 Answers   Accenture, TCS,


why java is called as a purely oops language.

3 Answers   TVS,


What is function and its example?

0 Answers  


what will be the output of this program main() { int i=1; while (i<=10); { i++; } }

11 Answers  






Give a method to count the number of ones in a 32 bit number?

4 Answers  


How will you allocate memory to a double pointer ?

2 Answers  


What is volatile in c language?

2 Answers   HCL, TCS,


Write a program in c to replace any vowel in a string with z?

0 Answers   IBS,


Explain the meaning of keyword 'extern' in a function declaration.

0 Answers  


What are the languages are portable and platform independent?Why they are like that?

1 Answers   Excel, Satyam,


how can make variable not in registers

1 Answers   TCS,


Categories