J
John Black
Hi,
I have 2 vectors, vector<Derived_class*> vec1, vec2; can I do the
following,
for (int i=0; i<vec1.size(); ++i){
for (int j=0; j<vec2.size(); ++j){
if (.. some comparision of vec1 and vec2[j]...){
Base_Class b = vec2;
vec2 = vec2[j];
vec2[j] = b;
}
}
}
Is there any problem here? In swapping I do not cast the pointer.
I have 2 vectors, vector<Derived_class*> vec1, vec2; can I do the
following,
for (int i=0; i<vec1.size(); ++i){
for (int j=0; j<vec2.size(); ++j){
if (.. some comparision of vec1 and vec2[j]...){
Base_Class b = vec2;
vec2 = vec2[j];
vec2[j] = b;
}
}
}
Is there any problem here? In swapping I do not cast the pointer.