Variable scope and lifetime

The variable, after declaration, has its own lifespan and it lasts until the subroutine in which it was created is completed. Sometimes we want her to keep its value even after leaving the subroutine. Also, the variable is visible only within the module in which the it is located. Is there a need for it to be seen outside the module? How to define the range and extend the life span of variables will be found in the text that follows.

Dynamic arrays

Sometimes we need to make an array that we are not sure of how many members will have. In this case should create dynamic arrays that, unlike the usual ones, do not have a fixed length. These arrays are declared in such a way that the number of members is omitted, and how many of them will be, or for how long the number of members of array should be increased is subsequently defined with commands that will be discussed in the text that follows.

Arrays

Arrays represent a group of variables of the same type. Since they often contain values that share common attributes, it is easier for us to assign them a unique name, and then to access each of them with an index number in a array. The index of the first member of an array is usually 0, and the index of the last one is smaller for one than the size of the array. It is possible to work with a whole array or with its individual members, they can be one or multi-dimensional …