Feng H.
asked 06/17/16Checking if all parentheses are balanced with a C program
I was trying to write a C program which checks if the parentheses (including brackets and curly braces) are balanced. My current program is on GitHub: https://github.com/testitem/JavaScriptPythonConvertedFiles/blob/master/parenthesesChecker.c - the current program displays nothing while it should display "Error: ] is in wrong place". Can anyone please help me with this? Thanks!
Darren
More
1 Expert Answer

Andy C. answered 10/16/17
Tutor
4.9
(27)
Math/Physics Tutor
count all the parenthesis. There should be an even number of them.
Use a stack.
Still looking for help? Get the right answer, fast.
Ask a question for free
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Find an Online Tutor Now
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.
Feng H.
06/18/16