Simple question.

Matteo Gelosa matteo at ghost.unimi.it
Mon Apr 29 23:32:17 AEST 1991


cfiddyme at gara.une.oz.au (Kith Kanan) writes:


> Could someone please tell me if it is possible to read a string with
> scanf() and not have the string printed on the screen.
	First: What do you mean with "not have the string printed on
	the screen"...???
	scanf() doesn't print anything aywhere at all.
	It simply scan standard input or a file opened with fopen()
	looking for the first object that match the format
	argument according to format rules.
	So if you do something like

	char	buffer[64];

	scanf("%s", buffer);

	it will read from standard input the first character sequence
	between any kind of blanks (' ', '\t', '\n'...) without 
	printing anything at all!!.

	Probably you mean how you can inserting characters from keyboard
	without echoing them on terminal. Lookup ioctl(2) and termio
	manuals you can get a lot of information about tty-s setting up.


						Matteo Gelosa.
						matteo at ghost.unimi.it



More information about the Comp.lang.c mailing list