mgetstrreads a character string from a fileCalling Sequencestr = mgetstr(n, [fd])Argumentsnnon-negative integer: how many characters should be
read.
fd
an integer: file descriptor as returned by
mopen: where characters should be read. The value -1 stands for the last opened file and is the default.
strthe character string to be read.Description
The mgetstr function attempts to read up
to n characters from a file. If end of file is
reached before n characters are read,
mgetstr returns the properly read values
only. As a consequence, when the read cursor is already at the end
of the file when mgetstr is called, it returns
an empty string no matter what value is provided for
n.
ExamplesSee Also
mclose
meof
mfprintf
fprintfMat
mfscanf
fscanfMat
mget
mopen
mprintf
mput
mputstr
mseek
mtell
mdelete
"Input/Output functions" section