1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145
|
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 6.7, http://www.gnu.org/software/texinfo/ -->
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>C-Style I/O Functions (GNU Octave (version 6.2.0))</title>
<meta name="description" content="C-Style I/O Functions (GNU Octave (version 6.2.0))">
<meta name="keywords" content="C-Style I/O Functions (GNU Octave (version 6.2.0))">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<link href="index.html" rel="start" title="Top">
<link href="Concept-Index.html" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Input-and-Output.html" rel="up" title="Input and Output">
<link href="Opening-and-Closing-Files.html" rel="next" title="Opening and Closing Files">
<link href="Saving-Data-on-Unexpected-Exits.html" rel="prev" title="Saving Data on Unexpected Exits">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.indentedblock {margin-right: 0em}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
kbd {font-style: oblique}
pre.display {font-family: inherit}
pre.format {font-family: inherit}
pre.menu-comment {font-family: serif}
pre.menu-preformatted {font-family: serif}
span.nolinebreak {white-space: nowrap}
span.roman {font-family: initial; font-weight: normal}
span.sansserif {font-family: sans-serif; font-weight: normal}
ul.no-bullet {list-style: none}
-->
</style>
<link rel="stylesheet" type="text/css" href="octave.css">
</head>
<body lang="en">
<span id="C_002dStyle-I_002fO-Functions"></span><div class="header">
<p>
Previous: <a href="Basic-Input-and-Output.html" accesskey="p" rel="prev">Basic Input and Output</a>, Up: <a href="Input-and-Output.html" accesskey="u" rel="up">Input and Output</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<span id="C_002dStyle-I_002fO-Functions-1"></span><h3 class="section">14.2 C-Style I/O Functions</h3>
<p>Octave’s C-style input and output functions provide most of the
functionality of the C programming language’s standard I/O library. The
argument lists for some of the input functions are slightly different,
however, because Octave has no way of passing arguments by reference.
</p>
<p>In the following, <var>file</var> refers to a filename and <code>fid</code> refers
to an integer file number, as returned by <code>fopen</code>.
</p>
<p>There are three files that are always available. Although these files
can be accessed using their corresponding numeric file ids, you should
always use the symbolic names given in the table below, since it will
make your programs easier to understand.
</p>
<span id="XREFstdin"></span><dl>
<dt id="index-stdin">: <em></em> <strong>stdin</strong> <em>()</em></dt>
<dd><p>Return the numeric value corresponding to the standard input stream.
</p>
<p>When Octave is used interactively, stdin is filtered through the command
line editing functions.
</p>
<p><strong>See also:</strong> <a href="#XREFstdout">stdout</a>, <a href="#XREFstderr">stderr</a>.
</p></dd></dl>
<span id="XREFstdout"></span><dl>
<dt id="index-stdout">: <em></em> <strong>stdout</strong> <em>()</em></dt>
<dd><p>Return the numeric value corresponding to the standard output stream.
</p>
<p>Data written to the standard output may be filtered through the pager.
</p>
<p><strong>See also:</strong> <a href="#XREFstdin">stdin</a>, <a href="#XREFstderr">stderr</a>, <a href="Paging-Screen-Output.html#XREFpage_005fscreen_005foutput">page_screen_output</a>.
</p></dd></dl>
<span id="XREFstderr"></span><dl>
<dt id="index-stderr">: <em></em> <strong>stderr</strong> <em>()</em></dt>
<dd><p>Return the numeric value corresponding to the standard error stream.
</p>
<p>Even if paging is turned on, the standard error is not sent to the pager.
It is useful for error messages and prompts.
</p>
<p><strong>See also:</strong> <a href="#XREFstdin">stdin</a>, <a href="#XREFstdout">stdout</a>.
</p></dd></dl>
<table class="menu" border="0" cellspacing="0">
<tr><td align="left" valign="top">• <a href="Opening-and-Closing-Files.html" accesskey="1">Opening and Closing Files</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="Simple-Output.html" accesskey="2">Simple Output</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="Line_002dOriented-Input.html" accesskey="3">Line-Oriented Input</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="Formatted-Output.html" accesskey="4">Formatted Output</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="Output-Conversion-for-Matrices.html" accesskey="5">Output Conversion for Matrices</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="Output-Conversion-Syntax.html" accesskey="6">Output Conversion Syntax</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="Table-of-Output-Conversions.html" accesskey="7">Table of Output Conversions</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="Integer-Conversions.html" accesskey="8">Integer Conversions</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="Floating_002dPoint-Conversions.html" accesskey="9">Floating-Point Conversions</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="Other-Output-Conversions.html">Other Output Conversions</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="Formatted-Input.html">Formatted Input</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="Input-Conversion-Syntax.html">Input Conversion Syntax</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="Table-of-Input-Conversions.html">Table of Input Conversions</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="Numeric-Input-Conversions.html">Numeric Input Conversions</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="String-Input-Conversions.html">String Input Conversions</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="Binary-I_002fO.html">Binary I/O</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="Temporary-Files.html">Temporary Files</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="EOF-and-Errors.html">EOF and Errors</a></td><td> </td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">• <a href="File-Positioning.html">File Positioning</a></td><td> </td><td align="left" valign="top">
</td></tr>
</table>
<hr>
<div class="header">
<p>
Previous: <a href="Basic-Input-and-Output.html" accesskey="p" rel="prev">Basic Input and Output</a>, Up: <a href="Input-and-Output.html" accesskey="u" rel="up">Input and Output</a> [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html" title="Index" rel="index">Index</a>]</p>
</div>
</body>
</html>
|