Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- void Stud::Merge(ABS_LIB &A, ABS_LIB &B)
- {
- Stud * M1 = dynamic_cast<Stud * > (&A);
- Stud * M2 = dynamic_cast<Stud * > (&B);
- int tmp=M1->count;
- for (int i=0;i<tmp;i++)
- {
- strcpy(M[i].name,M1->M[i].name);
- strcpy(M[i].topic,M1->M[i].topic);
- count++;
- }
- tmp+=M2->count;
- bool is=false;
- for (int i=count,j=0;i<tmp;i++,j++)
- {
- for (int p=0;p<M1->count;p++)
- {
- if(strcmp(M2->M[j].name,M1->M[p].name)==0)
- is=true;
- }
- if (is==false)
- {
- strcpy(M[i].name,M2->M[j].name);
- strcpy(M[i].topic,M2->M[j].topic);
- count++;
- }
- is=false;
- }
- }
Add Comment
Please, Sign In to add comment