How do I remove an element from an array (one-dimensional two-dimensional)? - page 3

 
Not exactly the same. But the best option for two-dimensional arrays is to use a structure. And then it becomes easier to work with arrays within it.
struct SA
{
     int i[], j[];
} A[];
 
Alexey Viktorov:
They haven't figured out how to make the compiler directly on the forum site yet.

It's faster to open the compiler and try it than to write a post about something that hasn't been invented on the site yet. Although it is clear that you have answered without any understanding of the question, and now you just want to get off the subject.

 
Ilya Malev:

It's faster to open the compiler and try it than to write a post about something that hasn't been invented on the site yet. Although it is clear that you have answered without any understanding of the question, and now you just want to get off the subject.

Yes think what comes into your head. Good riddance to you.

 
Konstantin Nikitin:
Not exactly. But the best option for two-dimensional arrays is to use a structure. And then it becomes easier to work with arrays inside it.

What if the array is four-dimensional?

 
When I do maths with my granddaughter, I focus her attention not on solving problems or even algorithms to solve them, but on the essence from which these problems arose.
 
Алексей Тарабанов:

What if the array is four-dimensional?

I don't care if it's 20. It all depends on the number of structures.
Here is a working example of my code.

struct SIndicator
{
     int  id;
     char array[];
};
//+------------------------------------------------------------------+
struct SPositions
{
     double              price;
     ENUM_ORDER_TYPE     type_positiot;
     SIndicator          indicators[];
};
 
int a[][2]={1,2,11,12,21,22};
ArrayCopy(a,a,2,4);// работаем как с одномерным
ArrayResize(a,ArrayRange(a,0)-1);  
 
Konstantin Nikitin:

You can have as many as 20. It all depends on how many structures there are.
Here is a working example of my code.

I don't program in OOP languages. As a matter of fact, I don't program at all, I just dabble.

At the same time, the problem of removing an element of an array with any number of dimensions in MT can already be solved about 35 years ago in PL/1, when there was no MT, but PL/1 already had four modes of memory management.

Hint: arrays in MT are static.

 

Dmitry Fedoseev:

// работаем как с одномерным

It's a pity that the phrase "working as one-dimensional" doesn't refer to method signatures, otherwise it would really be simple.

 
Ilya Malev:

It's a pity that the phrase "working as one-dimensional" doesn't refer to method signatures, otherwise it would really be simple.

Which methods? What signatures?

ArrayCopy() does not work with structures. But it does work with pointers. I'll have to try it.

Reason: