The problem is at return insert(cap->drt,x,poz--);
(*cap).data CXX0030: Error: expression cannot be evaluated
cap is the head of a double linked list.
It works for the afisare function (cap=cap->drt;) but crashes at insert
Both functions get the same pointer transmitted