Should I use a map, 3D array, or stick with a stack?

So far I can get this to work perfectly for every case except when there are more open braces than closed braces. Whenever the stack still contains any open braces I don't know how to find that particular open brace. I was wondering if including a map or changing my stack to take in 3D(?) array values so it can contain the coordinates of the char? If there is an easier way it would be nice if you guys could help guide me toward it because I'm stuck as to how I'm supposed to make it work. ;-;
Thank you so much!

My code:
http://pastebin.com/ZdrCWYdA

example: (should say "Unmatched open parenthesis { at row 39 and column 17")
http://pastebin.com/dWeJVMp1

what if:
Instead of storing braces in vector, you should just count them.
int openbrace;
int closebrace;

Everytime you see {
you do openbrace++
and everytime you see }
you do closebrace++

If openbrace != closebrace, there is an error.
Topic archived. No new replies allowed.