Is there a way to prevent getchar from echoing the input characters? I tried to write my own implementation of getchar, but the linker doesn't seem to let me do that. - Mike
Use: char getchar (void); Instead of: int getchar (void);
use _getkey instead?
I wanted to be able to use scanf without the echo. It seems like the only way is to replace getchar and ungetchar in the standard library using the library manager. OK, I'll use sscanf instead. But wouldn't it be nice if Keil allowed us to change the implementation of getchar and ungetchar? - Mike
My "char getchar(void){return 0;};" links just fine. What error message are you getting?
I've taken the Traffic example. If I put "char getchar(void){return 0;}" in Serial.c, at link stage I get *** ERROR L104: MULTIPLE PUBLIC DEFINITIONS SYMBOL: getchar MODULE: C:\KEIL\C166\LIB\C167S.LIB (GETCHAR) *** ERROR L118: REFERENCE MADE TO ERRONEOUS EXTERNAL SYMBOL: getchar MODULE: C:\KEIL\C166\LIB\C167S.LIB (SCANF) ADDRESS: 07A6H
"I wanted to be able to use scanf without the echo. It seems like the only way is to replace getchar..." Why not use _getkey to read into a buffer, and then sscanf?
View all questions in Keil forum