Click to See Complete Forum and Search --> : C Question.


nobby
12-13-2000, 05:25 AM
Does anyone know how to receive a single char input w/o having having to press Enter afterwards?

I thought it would be something like,

fprintf(stdprn, "whatever the message is");

which would print to the local printer. But I get a msg regarding stdprn, when I get back home I can give complete error msg.

Any inf0 would be great

Thanks

n0bbY

Strike
12-13-2000, 12:40 PM
You wouldn't use a print function to get input. To get input, you want to use getc and its cousins (like fgetc, which is better and probably what you are looking for).

Glaurung
12-13-2000, 03:47 PM
Doesn't getc expect an eol character?

Do a forum search on 'termios'. TheLinuxDuck posted once a code sample of how to do this.

[This message has been edited by Glaurung (edited 13 December 2000).]

nobby
12-14-2000, 12:17 AM
Ok I stuffed up the post.. The questions should have been.

1/ Getting a single char from keyboard w/o Enter

2/ Sending info to printer

Sorry about the confusion, and thanks for the replies

n0bbY

I'll have a look for that post Glaurung