A term used in computer programming. It refers to those variables local to specific functions that are automatically allocated on the stack during each invocation of the function.

Example:

	void
	swap(int *a, int *b)
	{
		int temp;	/* Automatic Variable! */

		temp = *b;
		*b = *a;
		*a = temp;
	}

They're called automatic because upon each invocation of a function, storage space for these variables is automatically allocated on the stack for them.

Note: The keyword "auto" exists for explicitly declaring an automatic variable within a block. Such as:


        ...
        {
                auto int temp;
                ...
        }
But since a variable within a block is automatic by default (as oposed to extern or static), the use of auto is redundant and obsolete.

Log in or register to write something here or to contact authors.