
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Telix/SALT v3.15 & RS-232, Hayes - <b>gets</b>
[<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
GETS
. Summary
gets(str <buffer>, int <max>);
. Description
The gets function allows the user to enter a complete string, and
use the arrow keys to edit it while it is being entered. <buffer> is
the string variable where the string should be put, while <max> is
the maximum number of characters the user may enter (from 0 to 80).
The user may edit the string as it is being entered, with the Left-
Arrow, Right-Arrow, Ctrl-Left-Arrow, and Ctrl-Right-Arrow keys as it
is being entered, and insert mode may be toggled on/off with the INS
key. String entry is over when the user presses Enter (Carriage Re-
turn on some computers). The user may press Esc to abort string en-
try, in which case the resulting string will have a length of 0.
. Return Value
The number of characters entered by the user are returned. If the
user pressed Esc to abort string entry, a value of -1 is returned.
. Example
int n;
str password[8];
printsc("Enter a password? ");
n = gets(password, 8);
See Also: getsxy
Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson