stdin

Returns the numeric file ID corresponding to the standard input stream of the application console mode.

Syntax

stdin()

Example

Example using stdin and stdout in a script run by the Console program:

fprintf(stdout(), 'fileID associated to stdin  is %d\n', stdin())
fprintf(stdout(), 'fileID associated to stdout is %d\n', stdout())
% now use stdin to retrieve input
fprintf(stdout(), 'enter string:');
fgetl(stdin)
fprintf(stdout(), 'enter string:');
reply = fgets(stdin())

fileID associated to stdin  is 0
fileID associated to stdout is 1
enter string:first
ans = first
enter string:second
reply = second

Comments

The value stdin can be used as the file ID when calling the read or input file functions in the console application.