What is an auto keyword in c?



What is an auto keyword in c?..

Answer / Vicky Jaiswal

The auto keyword in C is an optional specifier for declaring local variables within a function or block. When not used, the compiler automatically assumes that the variable being declared is local to the current function. Here's an example:

```c
#include <stdio.h>

void func() {
int x; // Variable declaration with auto keyword implicitly
auto int y; // Variable declaration with explicit auto keyword
}
```
In this code, both variables x and y are local to the function func and are automatically allocated on the stack.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More C Interview Questions

main() { float a=8.8; double b=8.8; if(a==b) printf("Equal"); else printf("not equal"); getch(); } what is the output? with reason

6 Answers   CSC,


How main function is called in c?

1 Answers  


What is modifier & how many types of modifiers available in c?

1 Answers  


What is the difference between File pointer and Internal Charecter Pointer?

2 Answers   TATA,


Is malloc memset faster than calloc?

1 Answers  


There are 3 baskets of fruits with worng lables,one basket has apple,another basket has orange,another has combination of apple and orange,what is the least way of interchange the lables.

15 Answers   Cisco, Google, MBT,


the number 138 is called well ordered number because the three digits in the number (1,3,8) increase from left to right (1<3<8). the number 365 is not well ordered coz 6 is larger than 5. write a program that wull find and display all possible three digit well ordered numbers. sample: 123,124,125,126,127,128,129,134 ,135,136,137,138,139,145,146,147 148 149,156.......789

5 Answers  


Read N characters in to an array . Use functions to do all problems and pass the address of array to function. 1. Print only the alphabets . If in upper case print in lower case vice versa.

1 Answers  


Is c is a middle level language?

1 Answers  


Explain what is the difference between far and near ?

1 Answers  


HOW TO SWAP TWO NOS IN ONE STEP?

16 Answers   Satyam,


21. #define square(x) x*x main() { int i; i = 64/square(4); printf("%d",i); }

3 Answers  


Categories