Question: hello I am having trouble with my c++ code, I am working with stacks. I keep getting an error message Segmentation fault (core dumped) and

hello I am having trouble with my c++ code, I am working with stacks. I keep getting an error message "Segmentation fault (core dumped)" and I cannot seem to figure out how to correct it. Below is the inside of my main() , also a copy of the professors questions. The input files are labled as blue in the professors question. In the output you will see that my code opens the six different files and checks each one to see if the braces and brackets are properly balanced. The only file that my code does not seem to work with is file number 5 it is suppose to print out "File not balanced" but instead gives me that error. Feel free to change the code. Thank you in advance.

hello I am having trouble with my c++ code, I am working

with stacks. I keep getting an error message "Segmentation fault (core dumped)"

CSE 202 Apps O YouTube CAS-California Sta nline C++ Compil: a. Amazon.com: Onlin R Facebook Write a program that decides whether a file contains balanced curly braces, parentheses, square brackets, and angled brackets. Input the file name, open it, and read one character at a time until end-of-file. If the file is balanced, your program should output "Balanced". If the file is not balanced, your program should output "Not Balanced". For example, the following files are balanced: tOJi(II)o) his is (test) file and [your] program should I (Iojut)ptu)It] ]I] Balanced #include using namespace std; main() int a[ 18a]; a [20]((13 2) a[5])2; cout > a [20]; And the following files are not balanced ? 15 not a file not balancedh Use a stack of characters stack

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!