! Hello friends!
I hope you are very well and things are going your the best in the world.
I also thank you for keep visiting my spaces Computer ... This month we'll talk a little programming, it will be something short to explain, discuss arrangements of memory or storage structures in the Borland C + + language.
! Started!
What are the arrangements of memory or storage structures?
They are just memory locations where it makes a "partition", so to speak, but in reality are positions where you can add different types of data.
What types of data we keep?
As we know that to use a variable, we declare, the same we do with the arrangements of memory, depending on the type of declaration, a variable takes a value type, if whole, will not accept decimals, if a character will not accept a number, if single precision, double precision not accept as is the value of pi (p) and vice versa. So depending on what values \u200b\u200bthe algorithm works (this term will discuss later) and the same arrangement and must declare the variables. Do
arrangements are be classified?
Sure, fall into three categories:
In one dimension (Vector)
Bidimensional (Matrix) Three-dimensional
(For reasons beyond my control I can not talk about it)
work
vectors with coordinates x, matrices with coordinates x and y while the three-dimensional arrays work with "x", "y" and "z". Syntax
The statement of arrangements, specifically Vector, in Borland C + +, is grabbing follows:
explain: the letter that precedes the brackets (which are necessary as part of the syntax) can be both uppercase and lowercase. So we put the number in brackets is the size that will define the vector.
Example: a [3], I [10].
In the first case, I declared a three-space vector and the second ten. It should be noted that the letter is called identifier like variables and the gaps are not counted from number 1, but from 0. In the first case, the three spaces are 0, 1 and 2. Not to say that the zero account, I understand. Imagine a rectangle split into three pieces and that the rectangle is called "a". The same with the second case, the identifier is "I" and consists of 10 slots (0 through 9).
The declaration of arrays, arrays specifically performed as follows:
explain: as vectors point is the handle, and most important thing I can say is that the two brackets are the coordinates that it said that. These arrangements can be any size of rows and columns and work just like the vectors in regard to the spaces. Importantly
To enter data either in vectors and matrices, using the for statement for the language C + + or for ... next to the case of Visual Basic.
For both files are saved from position 0 to the last, although the programmer can "play" with the repeat cycle and add the data back and forth in vectors and matrices by columns or introduce them to the parents ... this is only the logical development. Although, do not think you should go crazy for it, nor is that complicate your life, it depends on what kind of programmer you are. Declaration
language:
A vector in C + + we write as follows:
int D [3];
Q z [5];
A parent would be this:
EXAMPLE
int [2] [3];
PP float [4] [4];
This is something that is used to program when working with different data such as measures of blood from a group of people, the amount of water street in a city for three years ... depending on the problem you choose to use vectors or matrices.
Well, I think that's it.
Any comments or suggestions, I do know that I will read it with pleasure. Coming
talk about control structures.
Thanks for visiting my spaces, I hope you like it.
Cheers, take care that there are people who love them. Saellvertu
Until next month ... God willing.