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

I need a sort of an approximate strcmp routine?

1 Answers  


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

1 Answers  


Explain why can’t constant values be used to define an array’s initial size?

1 Answers  


What is the correct declaration of main?

1 Answers  


Print the foll in C...eg when n=5 the o/p must b + + + + + + + + + + + + + + + + +

1 Answers  


i want the code for printing the output as follows 4 4 3 3 2 2 1 1 0 1 1 2 2 3 3 4 4

2 Answers  


Tell us the difference between these two : #include"stdio.h" #include<stdio.h> define in detial.

5 Answers  


without using arithmatic operator solve which number is greater??????????

1 Answers   Accenture,


how can i get output like this? 1 2 3 4 5 6

6 Answers   Excel,


write a program in 'c' to find the value of p[i+1]^n.p,i,n are arguments of a macro and n is a integer

1 Answers  


Write an efficient algo and C code to shuffle a pack of cards.. this one was a feedback process until we came up with one with no extra storage.

1 Answers  


without using arithmatic operator convert an intger variable x into x+1

3 Answers  


Categories