+ 4
in c we wanted to check how many pushes cause heap overflow for array based stack
in c we wanted to check how many pushes cause heap overflow for array based stack. This code is written to int main, is this correct to check in this way, so we will be waiting to program crush and see the last printed heapoverflow_pushs? int heapoverflow_pushs=0; while(1) { push(stk,i); heapoverflow_pushs++; printf("stack overflow pushs: %d\n",heapoverflow_pushs ); }
2 ответов