C++ INPUT COMMAND
Posted on 2000-02-19
I'm trying to write a program that simulates a HDLC (high-level data-link control) flag. The program will received characters from the keyboard until it detects the flag. Upon detection of the first flag, the program will continue to receive characters from the keyboard until a flag is detected again. The output of the program will be the data between the two flags. The constraint for this program is the person has to enter from the keyboard WITHOUT hitting the "enter" key. That means as soon as he or she types a character, the program will start to process the data. I have all the different loops required and I'm using array strings to compare with the flag and save the output to a different array for output. But I can't figure out the C++ command that allows the person to enter characters WITHOUT having to hit the "enter" key. I thought cin.get() will do the trick but this command still requires the user to hit the "enter" key.