Question: Text editor buffer. Develop a data type in C++ for a buffer in a text editor that implements the following API: The driver program interface
Text editor buffer. Develop a data type in C++ for a buffer in a text editor that implements the following API:
The driver program interface is a menu driven-based application that displays buffer operations.
Hint : Use two stacks.
public class Buffer Buffer() create an empty buffer void insert(char c) insert c at the cursor position char delete() delete and return the character at the cursor void left(int k) move the cursor k positions to the left void right(int k) move the cursor k positions to the right int size() number of characters in the buffer API for a text buffer
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
