ݺߣ
Submit Search
4. yapılar
•
Download as DOCX, PDF
•
0 likes
•
135 views
K
karmuhtam
Follow
Nesneye Dayalı Programlama
Read less
Read more
1 of 2
Download now
Download to read offline
More Related Content
4. yapılar
1.
#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();
2.
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; }
Download