Review: the kinds of variables in a Java program

The way to define different kinds of variables in a Java program is as follows:

Where (inside/outside a method) and how (with/without keyword static) determines the kind of a variable

The kinds of variables in a C program

A C program can define 5 kinds of variables and they are defined as follows:

Where (inside/outside a method) and how (with/without keyword static) determines the kind of a variable

The kinds of variables in a C program

Parameter variables in C are the same as in Java:

Parameter variables are defined inside the braces ( ... ) of the function header
Used for short term information storage (used by 1 function)

The kinds of variables in a C program

Local variables in C are the same as in Java:

Local variables are defined inside the body of a function without using keyword static
Used for short term information storage (used by 1 function)

The kinds of variables in a C program

Global variables in C are similar to public class (static) variables in Java:

Global variables are defined outside the body of a function without using keyword static
Used for long term information storage (by multiple functions in any C program file)

The kinds of variables in a C program

Static global variables in C are similar to private class (static) variables in Java:

Static global variables are defined outside the body of a function using the keyword static
Used for long term information storage (by multiple functions in same C program file)

The kinds of variables in a C program

Static local variables in C:   (no comparison in Java)

Static local variables are defined inside the body of a function using the keyword static
Used for long term information storage (used by one function)

The kinds of variables in a C program

Practice identifying the 5 kinds of variables in this C program: