Christi444
Technical User
I am trying to figure out how to go about compacting an array of pointers within a method. I have two classes (eg. Book and Book Library) The array is an array of pointers called bl of type Book and is initialized and declared in the Book Library class. I have tried to attempt using a for loop and erasing the entry with the specified criteria but when ever I try sl.erase(i,1) and then proceed, I get an error. Does any one know how I can go about deleting various entries (compacting the array)
bool Book :: compactArray()
{
for(int i=0; i < anarbitrarysize ; i--) //forloop
{
if(sl->getCheckoutstatus()== false)
{
--------THE PROBLEM-------
//I want to eliminate every instance from the
//array that is false
}
}
}
THANK U
bool Book :: compactArray()
{
for(int i=0; i < anarbitrarysize ; i--) //forloop
{
if(sl->getCheckoutstatus()== false)
{
--------THE PROBLEM-------
//I want to eliminate every instance from the
//array that is false
}
}
}
THANK U