ݺߣ

ݺߣShare a Scribd company logo
#include <conio.h>
#include <iostream>
#include <list>
usingnamespace std;
struct agac {
int kod;
int mal;
};
struct Acc {
list<agac*>agaclistesi;
list<Acc*>acclist;
};
Acc * acc = newAcc();
Acc * acc1 = newAcc();
Acc * acc2 = newAcc();
intal(Acc*acc)
{
acc->agaclistesi.pop_back();
cout<<acc->agaclistesi.size()<<endl;//4 //6
return0;
}
intmain()
{
agac * cam = newagac();
agac * kavak= newagac();
cam->kod=2;
cam->mal=5;
kavak->kod=9;
kavak->mal=25;
acc->agaclistesi.push_back(cam);
acc->agaclistesi.push_back(kavak);
acc->agaclistesi.push_back(cam);
acc->agaclistesi.push_back(kavak);
acc1->acclist.push_back(acc);
acc1->acclist.push_back(acc);
cout<<acc1->acclist.size()<<endl;//1
cout<< (acc1->acclist.front())->agaclistesi.size()<<endl;//2
acc2=acc1->acclist.front();
cout<<acc2->agaclistesi.size()<<endl;//3
al(acc1->acclist.front());//4
cout<<acc->agaclistesi.size()<<endl;//5
al(acc);//6
cout<<"son"<<endl;//7
getch();
return0;
}

More Related Content