We are running a survey to help us improve the experience for all of our members. If you see the survey appear, please take the time to tell us about your experience if you can.
The application waits for a specific character "a" in the serial port using getchar()and then outputs a string using printf("hello")once the character is received. The problem is that the application listening for the "hello" gets allways "ahello". Khen Truong
Chapter 8, "Library Reference" has a table listing the Stream Input & Output Routines. The description of getchar says: "Reads and echoes a character using the _getkey and putchar routines." The detailed description, later in the same chapter, says, "The getchar function reads a single character from the input stream using the _getkey function. The character read is then passed to the putchar function to be echoed." If you place your cursor on the 'getchar' in your code, then press F1, it will bring up the same description. It's my emphasis in both cases, but I think it's fairly clear - it's doing just what it says on the tin!