C++ Stack Program - Bracket Matching