what is the use of ‘auto’ keyword?



what is the use of ‘auto’ keyword?..

Answer / vatsava

scope of the auto keyword is local to the block in which
the variable is defined.

for ex:
main()
{
auto int i=1;
{
auto int i=2;
{
auto int i=3;
printf("%d",i);
}
printf("%d",i);
}
printf("%d",i);
}
the op would be 321

Is This Answer Correct ?    4 Yes 3 No

Post New Answer

More C Interview Questions

how can I convert a string to a number?

0 Answers  


What are register variables in c?

0 Answers  


implement OR gate without using any bitwise operator.

1 Answers   Alcatel, Wipro,


wt is d full form of c

6 Answers   TCS, Wipro,


What is the general form of #line preprocessor?

0 Answers  






how can i get this by using for loop? * ** * **** * ******

3 Answers   Excel,


explain about storage of union elements.

2 Answers   ABC, Bosch,


why array index always starts from zero??

4 Answers   TCS,


What does printf does?

0 Answers  


Why is not a pointer null after calling free?

0 Answers  


How pointers are declared?

0 Answers  


What is Dynamic memory allocation in C? Name the dynamic allocation functions.

1 Answers  


Categories