This chapter describes using arrays and pointers in the following contexts: The result obtained from the evaluation of an expression can be used in many ways.For example, it can be printed or passed to a subprogram.These are user-defined operators, which are either unary or binary operators.
The following example shows an assignment statement: . Fortran has expressions of other types, such as logical, character, and derived type.
Values of expressions of these other types can be assigned to variables of these other types.
In many cases, however, the value is assigned to a variable and that value can be used later in the program by referencing the variable.
Execution of the assignment statement causes the expression to be evaluated (by performing the computation indicated), and then the value of the expression is assigned to the variable on the left of the equal sign.
Thus, a compiler has a great deal of freedom to rearrange or optimize the computation, provided the rearranged expression has the same mathematical meaning.
Arrays and pointers as objects can appear in expressions and assignment statements.
When the operator is an intrinsic operator such as with two numeric operands means that the two operands are added together.
For the user-defined operators, the interpretation is provided by a user-supplied function subprogram with a designation that this subprogram is to be used to define the operation.
These capabilities are provided within the general framework for expressions, which consists of three sets of rules: An expression is formed from operators and operands.
There is no change from FORTRAN 77 in the rules for forming expressions, except that a new class of operators has been defined.