what is the difference between auto and static keywords

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

what is reason of your company position's in india no. 1.

1770


If the size of int data type is two bytes, what is the range of signed int data type?

581


What is self-referential structure in c programming?

648


find the output? void r(int a[],int c, int n) { if(c>n) { a[c]=a[c]+c; r(a,++c,n); r(a,++c,n); } } int main() { int i,a[5]={0}; r(a,0,5); for(i=0;i<5;i++) printf("\n %d",a[i]); getch(); }

1855


What are the basic data types associated with c?

805






Write a program to implement a round robin scheduler and calculate the average waiting time.Arrival time, burst time, time quantum, and no. of processes should be the inputs.

615


Place the #include statement must be written in the program?

562


Why main is used in c?

579


What is the basic structure of c?

549


Why is a semicolon (;) put at the end of every program statement?

617


Can the size of an array be declared at runtime?

598


What does %c mean in c?

640


if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above

702


What is the maximum length of an identifier?

657


What is the difference between ā€˜gā€™ and ā€œgā€ in C?

2493