Priority checker for infix-to-postfix converter
There is duplicated code that can be removed.

static int precedence(char operator) {
    switch (operator) {
      case '*': case '/':
        return 2;
      case '+': case '-':
        return 1;
      default:
        return 0;
    }
}

int hasLowerPriority(char operator, char otherOperator) {
    return precedence(operator) &lt; precedence(otherOperator);
}


At that point, you might as well get rid of the hasLowerPriority() function altogether, since precedence(operator) &lt; precedence(otherOperator) is clearer and more readable.

(Note that operator is a reserved keyword in C++, but not in C.  You might want to rename it to op or something.)