Code:
1. create stack of char's named myStack
2. for loop for while j is less than the length of lineToCheck
a) create a char equal to the value of lineToCheck at index=j b) switch on that char
* If that char is equal to an opening mark ( {, [, or ( ) push it onto the stack and break * If that char is equal to a closing mark ( }, ], or ) ) do the following:
-> if the stack is not empty, do the following:
1) create a char equal to the top of the stack, and pop it 2) if ch is an opening bracket (or brace or parenthesis) and popper is not a closing bracket (or brace or parenthesis), then return the error message
-> else if the stack IS empty, then return the error message
* Now break from the switch
c) End the for loop
3. if the stack is not empty at the end, return an error message
4. Now that we've checked everything, if everything came out, then success
If you're not going to use the return value, then you shouldn't be returning things -- so either you want a void function and do the printing in the function, or you return the string and do the printing in main.