Home / Questions / What is keyword auto for?
Explanatory Question

What is keyword auto for?

👁 1,835 Views
📘 Detailed Answer
🕒 Easy to Read
Read the answer carefully and go through the related questions on the right side to improve your understanding of this topic.

Answer with Explanation

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.