Anonymous user
Truth table: Difference between revisions
→{{header|C}}: Added two functions in order allow the application to use the field "top" only through the operations on the stack.
m (→{{header|R}}) |
(→{{header|C}}: Added two functions in order allow the application to use the field "top" only through the operations on the stack.) |
||
Line 210:
exit(1);
}
}
void make_empty(stack_of_bool *sp) {
sp->top = -1;
}
int elems_count(stack_of_bool *sp) {
return (sp->top) + 1;
}
Line 229 ⟶ 237:
stack_of_bool s;
stack_of_bool *sp = &s;
for (i = 0; i < expr_len; ++i) {
e = expr[i];
Line 257 ⟶ 265:
}
}
if (
printf("\nStack should contain exactly one element.\n");
exit(1);
|