[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

input with a default value

From: ns-c0de
Subject: input with a default value
Date: Mon, 18 Dec 2006 15:18:03 -0800 (PST)

I would like to have a string input from keyboard where it can have a default
value that is printed on screen so user can edit it or just hit /enter/

my input is via fgets(string,255,stdin)

i've noticed that if something is in the keyboard buffer before you call the
fgets, or any other input stdin function that gets printed.. that's why we
have fpurge.. So, I've tried putting my default value on stdin with fputs,
and then calling fgets, but that didn't work :(

Any idea how to do this? ... without writing my own input functions :D
View this message in context:
Sent from the gcc - Gnu Help List mailing list archive at

reply via email to

[Prev in Thread] Current Thread [Next in Thread]