Hacker News new | past | comments | ask | show | jobs | submit login

It doesn't do type deduction there.

In original C you could declare variables without a type, and these variables with auto have no type.

So this "auto" is essentially saying "this variable without a type uses automatic storage". That's a completely different language feature from "deduce the type of this variable".




A variable without a type is 'int' so ```auto xx;``` means an int on the function local variable stack.


Thanks.




Join us for AI Startup School this June 16-17 in San Francisco!

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: