Question: Modify the code of Figure 4.18 ( in eBook) to support storing variable-length strings of at most 255 characters. The stack array should have type

Modify the code of Figure 4.18 ( in eBook) to support storing variable-length strings of at most 255 characters. The stack array should have type char. A string is represented by a series of characters (one character per stack element), with the length of the string stored in the stack element immediately above the string itself, as illustrated by the figure below. The code should accept an input string from, {,},(,),[,] and whether the pairs and the orders of {,},(,),[,] are correct in exp.
For example, the program should print true for exp = [()]{}{[()()]()} and false for exp = [(])
Note: You need to submit the source code and the output please build on the code from 4.18
11 Array-based stack implementation template
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
