c++ the auto keyword | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

c++ the auto keyword

i just know that auto specified the type and he has more byte than int type

20th Apr 2019, 9:56 AM
Idris Abdellah
Idris Abdellah - avatar
1 Answer
+ 6
"auto" doesn't specify the type. It tells the compiler to derive the variable's type from the specified literal. auto i{0} will be an integer because it is initialized with an integer literal (0). I never heard that auto "has more byte than int type" and I doubt that that is true.
20th Apr 2019, 10:26 AM
Anna
Anna - avatar