What is the use of auto key word in storage class | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

What is the use of auto key word in storage class

actually auto is one type storage class but we are not using it.if we want to declare a local variable we will give syntax like 'int varname' but no auto then where we are using it???

11th Mar 2017, 5:01 PM
Swamy Kanuri
Swamy Kanuri - avatar
1 Answer
0
my answer is;it is used to as type deduction means if we are not using datatype it will decide the data type try this #include<iostream> using name space std; class Test{ Test() { var = 12 var 1='a' cout<<var<<var1;} int main { Test obj; return 0;} it will print both values as 12 and 'a'
11th Mar 2017, 5:07 PM
Swamy Kanuri
Swamy Kanuri - avatar