This I have removed from an old C book, the C book, I am learning c but I do not understand the last two results that this program gives that are a 100 and 99, I do not understand why it returns the vector in that way. Thank you very much.
#include <stdio.h>
static int buf[100];
static int length;
static void fillup(void){
int i = 0;
while(length < 100){
buf[length++] = 0;
i++;
printf("%d, ",buf[i]);
}
}
int callable(){
if(length == 0){
fillup();
}
return(buf[length--]);
}
int main(){
int a;
a = callable();
printf("%d\n",a);
getchar();
return 0;
}