What is static and auto variables in c?



What is static and auto variables in c?..

Answer / Divyendu Singh

"Static variables are declared with the storage class keyword 'static'. They retain their values between function calls and have internal linkage. Auto variables, on the other hand, are not explicitly declared as static. They are created when a function is called and destroyed when it returns. They have external linkage."

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

What is the use of a semicolon (;) at the end of every program statement?

2 Answers  


what are the 10 different models of writing an addition program in C language?

1 Answers  


Write a code to remove duplicates in a string.

1 Answers   Expedia,


application areas a 'c' a) operating system b) graphics, interpreter, assembler c) program evalution, communication softwares d) all the above

1 Answers  


what's the return value of malloc()

9 Answers  


What is c language & why it is used?

1 Answers  


What are 'near' and 'far' pointers?

1 Answers  


A SIMPLE PROGRAM OF GRAPHICS AND THEIR OUTPUT I WANT SEE WAHAT OUTOUT OF GRAPHICS PROGRAM

1 Answers   HCL,


Can the sizeof operator be used to tell the size of an array passed to a function?

1 Answers  


What are predefined functions in c?

1 Answers  


write a c program to find reminder and quotient if one number is divided by other.to code this program don't use more than 2 variables

2 Answers   TCS,


Is c++ based on c?

1 Answers  


Categories