int main(int argc, char **argv) { both_null(); pattern_null(); text_null(); pattern_larger_than_text(); both_empty(); empty_pattern(); empty_text(); all_match(); no_match(); non_overlapping_match(); overlapping_match(); }
int main(void) { char ch, popped; printf("Enter parentheses and/or braces: "); while ((ch = getchar()) != '\n') { if (ch == '(' || ch == '{') { push(ch); } else { popped = pop(); if (popped == '(' && ch != ')') no_match(); else if (popped == '{' && ch != '}') no_match(); } } if (!is_empty()) { no_match(); } else { printf("Everything matches!\n"); } }
void stack_underflow(void) { no_match(); }