Home » Blog » What is keyword auto for?

What is keyword auto for?

By default every local variable of the function is automatic (auto). In the below function both the variables ‘i’ and ‘j’ are automatic variables.

void f() {
   int i;
   auto int j;
}

NOTE − A global variable can’t be an automatic variable.

Leave a Reply

Your email address will not be published.