#include "stdafx.h" #include "list.h" #include #include using namespace std; int main() { List a; a.insertFirst(new Data("Cervena", 255, 0, 0)); a.insertLast(new Data("Zelena", 0, 255, 0)); a.insertFirst(new Data("Modra", 0, 0, 255)); a.print(); Data * t = a.first; a.insertAfter(t, new Data("Zluta", 255, 128, 0)); t=a.first; a.insertBefore(t, new Data("Oranzova", 255, 128, 50)); t = a.last; a.insertBefore(t, new Data("Ruzova", 255, 200, 200)); a.print(); List b; while (a.first != nullptr) { Data* data = a.first; a.remove(data); b.insertFirst(data); } b.print(); a.purge(); a.print(); system ("pause"); return 0; }