Modify the program so that it prompts the user to enter an entire line, reads the line, then echoes the entire line. Read only one byte at a time from the keyboard.Explain what you did.
#include int main(void) { char aLetter; write(STDOUT_FILENO, "Enter one character: ", 21); // prompt user read(STDIN_FILENO, &aLetter, 1); // one character write(STDOUT_FILENO, "You entered: ", 13); // message write(STDOUT_FILENO, &aLetter, 1); // echo character return 0; }
Get Answers For Free
Most questions answered within 1 hours.