Hi,
I want to delete a column of a 2-dimensional vector using erase.
Actually the array is dynamic both row and column wise,so i opt for vector, now i want to delete using erase,
[code=cpp]
vector<vector <int>>::iterato r ptr1;
vector<int>::it erator ptr2,ptr3;
vector<int> cr1;
vector<vector<i nt>> c2;
ptr3=cr1.begin( );
while(ptr3 != cr1.end())
{
ptr1=c2.begin() ;
while(ptr1!=c2. end())
{
ptr2=(*ptr1).be gin();
while (ptr2!=(*ptr1). end())
{
if ( (*ptr2)== (*ptr3))
{
c2.erase(...... . );
break;
break;
}
ptr2++;
}
ptr1++;
}
ptr3++;
}
[/code]
Please help.What should i fill in ......
I want to delete a column of a 2-dimensional vector using erase.
Actually the array is dynamic both row and column wise,so i opt for vector, now i want to delete using erase,
[code=cpp]
vector<vector <int>>::iterato r ptr1;
vector<int>::it erator ptr2,ptr3;
vector<int> cr1;
vector<vector<i nt>> c2;
ptr3=cr1.begin( );
while(ptr3 != cr1.end())
{
ptr1=c2.begin() ;
while(ptr1!=c2. end())
{
ptr2=(*ptr1).be gin();
while (ptr2!=(*ptr1). end())
{
if ( (*ptr2)== (*ptr3))
{
c2.erase(...... . );
break;
break;
}
ptr2++;
}
ptr1++;
}
ptr3++;
}
[/code]
Please help.What should i fill in ......
Comment