The development of arrays. If there is something you like please write to [email protected] or in LK.
The first category is functions that allow you to find the size and rank of a dynamic array. Also, mql4 arrays obey this rule, I show the specifics in the video.
If you pass arrays to your functions and don’t want to pass unnecessary parameters to functions, then these functions will be very useful to you.
Finding the size.
Example you have declared a regular variable
Code: int Q=(int)new int[10];
Next, you pass this object as a number and get the size of the function that I offer you. Finding the rank.
Suppose you have assembled a multidimensional dynamic array of this type [2][3][4][5]
and shoved it into the variable Q, then you passed the variable to the function, and you need to find out that the rank of this array is 4em. You call the function and get the rank from the q variable.
You can’t find the size of a static array, you can only calculate it. In my materials, I show how to do this. As practice shows in my experience, dynamic arrays are used in 85% of cases. As for the rank of a static array, a static array with all its data and parameters lies in one block, therefore it is also impossible to get and calculate the rank of a static array. But later, functions will be developed that will simulate static single-loop arrays.
By sending you the code with the functions, I will send you a video of what my calculations are based on. If you are not too lazy, then you can make a lot of interesting functions on these prototypes.
Please note that my data types take up memory as on this resource, i.e. they are calibrated very thinly. If something doesn’t work out, write to us.
Rubrice2.
I offer you several functions for working with dynamic / multi-contour arrays, later this will be simulated with a static array.
The 1st can create an array of any rank, prescribing and allocating memory for all dimensions. Example you need to create a Ding. massiv array[2][3][4][4][10], you put the data in a one-dimensional array descriptor int opisat[]={5,2,3,4,4,10}, then you pass 2 pointers to the function, it digests it and collects it for you 5th array.
2nd can display all the columns or information on the desired regularity.
3. destroys such an array completely, meaning all dimensions.
The latter output single parameters: return a value, assign it, and so on. In them, you pass an array of any rank and can manage this case in a loop during the execution of the program. I briefly showed you how it works in the video. If the video is deleted (because I was in a situation when the channels were blocked), then write to me and I will send it to you by email.
komposter
Do you train in programming? Or is there a practical problem for which all this is necessary?
Here you will hardly find support.
seric29
Due to the fact that I want to improve the previous functions and also write a memory allocation/allocation function, I will take a big break.
I planned to write functions to increase and decrease the rank. Example there is a dynamic array mas[3][4], next you want to put another layer of mas[3][4][2] . To reduce the rank, there is such a function: from the array mas[3][4][2], we get mas[3][4]. I also wanted to create a function that will change the rank like this: from mas[3] we get mas[2][3], i.e. we increase the array by 2 times vertically, similarly in the direction of decreasing. It was also planned to write such functions that will change the width of a multidimensional dynamic array.
If someone will be interested under the order will do, if not in normal mode in a year or more will appear.