Codice:
struct posizione {
int x;
int y;
struct posizione *pun;
};
struct posizione *testa=NULL;
int push(struct posizione *p)
{
struct posizione *newp;
newp=(struct posizione *)malloc(sizeof(struct posizione));
if (newp!=NULL)
{
newp->x=p->x;
newp->y=p->y;
newp->pun=testa;
testa=newp; //non mi č chiaro questo passaggio
return 0;
}
else
{
return 1;
}
}
č corretto secondo voi?