ti mostro ciò che ho fatto per la coda dinamica
metto solo l'implementazione del push poichè hai detto qualcosa sull'inserimento.
codice:
typedef int E;
struct record;
typedef record *P;
struct record { E elem; P punt;}
class coda{
private:
P testa, coda;
public:
coda () {testa=0;}
coda( const coda & c) //che è quello che vorrei capire come fare
~coda()
const &operator =(const coda $ c) //anche questo dovrei sviluppare fare
void push(E e);
void pop (E & e);
bool empty() {return testa ==0;}
bool full() {return false;}
}
void Coda::push (E e){
P q=new record;
q->elem=e;
if(testa ==0) {testa = q;}
else {coda->punt=q;}
q->punt=0;
coda=q;}
come sviluppo ciò che mi hai detto?