Considere o código em C mostrado abaixo:
#include <stdlib.h>
typedef struct x{
int i;
struct x* y;
}* tx;
tx f (int n, tx m) {
tx l = (tx) malloc (sizeof(struct x));
l->i = n;
l->y = m;
return l;
}
int g (void) {
tx p, q;
int s = 0;
q = f(1, f(1, f(2, f(3, f(5, f(8, 0))))));
q->y=q->y->y;
p = q;
while (p) {
s+=p->i;
p=p->y;
}
return s;
}
O valor retornado na chamada da função g, será: