Clearing an array of defined element(s) - page 2

 
TheXpert:
One has 42 products, another 6, another 30. I'm afraid to imagine what an asshole there is inside with such questions and answers

And if you are so clever, show us your implementation, without it you will remain just a flooder...

 
Maxim Kuznetsov:

a bit more (a couple of earth diameters) and we'll come to a functional one :-)

set target [ filter $source [ lambda x { expr $x !=3 } ]

it's tcl, it's even shorter in lisp.

Well, it's not serious. If pulling elephants to solve this particular small problem, I'd mention STL::remove(array, value).

 
void DelEl(double & a[],double v){
   int sz=ArraySize(a);
   for(int i=sz-1;i>=0;i--){
      if(a[i]==v){
         sz--;
         for(int j=i;j<sz;j++){
            a[j]=a[j]+1;
         }
      }
   }
   ArrayResize(a,sz);
}
 
TheXpert:
One has 42 products, one has 6, one has 30. I'm afraid to imagine what an asshole it is inside with all those questions and answers

:))))

 
TheXpert:
One has 42 products, the other 6, the third 30. I'm afraid to imagine what an asshole it is in there with all those questions and answers.

30 is about me? You're just trying to "shine" again, aren't you? Aren't you tired of getting in the puddle yet?

Maybe it's time you started taking your own advice - envy in silence?

About g - that's very interesting, what is it, if you're afraid to write from your verified account.

 
From the author of the question - now a table measuring the performance of all the options ;-).
 
Vladimir Pastushak:

A silly question is an unasked question.

I have several solutions to the problem, but I keep looking for better solutions and learning from others.

What problem?

 
Алексей Тарабанов:

What task?

Clearing an array.

 
Vladimir Pastushak:

A silly question is an unasked question.

I have several solutions to the problem, but I keep looking for better solutions and learning from others.

I need to work out the basis of the problem. There is another way - a linked list, maybe that would work better.

 
Dmitry Fedoseev:

I need to get the basic task sorted out. There is also a way - a linked list, maybe that would work better.

The main task is to clear the array of given values.