3
I’d like to understand how the pop
in batteries.
I just put the part that I don’t understand, I know that in function pop()
there is also the empty check, but I only put the part I did not understand.
It turns out that that function my teacher passed the p
points to n
and this will only overwrite when used the push()
and do not exclude the value. This is correct?
define MAX = 50;
struct Pilha {
int n;
float vet[MAX];
}
float pop(Pilha *p) {
float v;
v = p->vet[p->n];
p->n--;
return v;
}
I don’t know if you know that you can vote for everything on the site as well as accept an answer to your questions. Check out the [tour] of the site.
– Maniero