what is the use of ‘auto’ keyword?

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


Please Help Members By Posting Answers For Below Questions

Why n++ execute faster than n+1 ?

1829


struct screen_pos{ int row, col } ;move_right(cursor)struct screen_pos *cursor;{ cursor.col++; } /* This statementhas a syntax error */What is the correct statement a) cursor.col = cursor.col + 1; b) col.cursor++; c) *cursor.col++; d) pointer

755


Are comments included during the compilation stage and placed in the EXE file as well?

663


What is integer constants?

606


What are header files and what are its uses in C programming?

624






Write a C program to count the number of email on text

1412


How do you use a pointer to a function?

621


What is stack in c?

601


.find the output of the following program? char*myfunc(char*ptr) { ptr +=3; return (ptr); } int main() { char*x,*y; x="HELLO"; y=myfunc(x); printf("y = %s ",y); return 0; }

1984


How can I pad a string to a known length?

605


Explain what’s a signal? Explain what do I use signals for?

604


What are the __date__ and __time__ preprocessor commands?

565


If i have an array 0 to 99 i.e,(Size 100) I place the values 1 to 100 randomly like a[0]=29,a[1]=56 upto array[99].. the values are only between 1 to 100. getting the array values by using scanf.. If i entered one wrong element value line a[56]=108. how can i find it.. and also how to find the missing value in 1 to 100.. and i want to replace the missing values.. any one of them know please post your answer..

1582


Explain 'bus error'?

549


Is there a way to compare two structure variables?

610