S
Sean Dalton
Hello,
I have a two sets OLDLIST and REMOVE.
I would like to remove every element in OLDLIST if it is also occuring
in REMOVE
and store the remaining elements from OLDLIST into NEWLIST.
So far, I have read in both lists but I'm struggling comparing the
elements
- I have something like
double oldlist[oldsize];
double remove[remsize];
for(i = 0; i < oldsize; i++)
{
for(k = 0; k < remsize; k ++)
if(oldlist != remove[k])
{
cout<<oldlist[k]<<endl;
}
}
Obviously this is not working because I need to compare all elements
from REMOVE *at once* with oldlist. So how do I compare all
elements
at once?
Many thanks,
Sean
I have a two sets OLDLIST and REMOVE.
I would like to remove every element in OLDLIST if it is also occuring
in REMOVE
and store the remaining elements from OLDLIST into NEWLIST.
So far, I have read in both lists but I'm struggling comparing the
elements
- I have something like
double oldlist[oldsize];
double remove[remsize];
for(i = 0; i < oldsize; i++)
{
for(k = 0; k < remsize; k ++)
if(oldlist != remove[k])
{
cout<<oldlist[k]<<endl;
}
}
Obviously this is not working because I need to compare all elements
from REMOVE *at once* with oldlist. So how do I compare all
elements
at once?
Many thanks,
Sean