File: C_002dStyle-I_002fO-Functions.html

package info (click to toggle)
octave 3.8.2-4
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 84,396 kB
  • ctags: 45,547
  • sloc: cpp: 293,356; ansic: 42,041; fortran: 23,669; sh: 13,629; objc: 7,890; yacc: 7,093; lex: 3,442; java: 2,125; makefile: 1,589; perl: 1,009; awk: 974; xml: 34
file content (153 lines) | stat: -rw-r--r-- 9,156 bytes parent folder | download | duplicates (3)
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
146
147
148
149
150
151
152
153
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Created by GNU Texinfo 5.2, http://www.gnu.org/software/texinfo/ -->
<head>
<title>GNU Octave: C-Style I/O Functions</title>

<meta name="description" content="GNU Octave: C-Style I/O Functions">
<meta name="keywords" content="GNU Octave: C-Style I/O Functions">
<meta name="resource-type" content="document">
<meta name="distribution" content="global">
<meta name="Generator" content="makeinfo">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<link href="index.html#Top" rel="start" title="Top">
<link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
<link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
<link href="Input-and-Output.html#Input-and-Output" rel="up" title="Input and Output">
<link href="Opening-and-Closing-Files.html#Opening-and-Closing-Files" rel="next" title="Opening and Closing Files">
<link href="Saving-Data-on-Unexpected-Exits.html#Saving-Data-on-Unexpected-Exits" rel="prev" title="Saving Data on Unexpected Exits">
<style type="text/css">
<!--
a.summary-letter {text-decoration: none}
blockquote.smallquotation {font-size: smaller}
div.display {margin-left: 3.2em}
div.example {margin-left: 3.2em}
div.indentedblock {margin-left: 3.2em}
div.lisp {margin-left: 3.2em}
div.smalldisplay {margin-left: 3.2em}
div.smallexample {margin-left: 3.2em}
div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
div.smalllisp {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}
pre.smalldisplay {font-family: inherit; font-size: smaller}
pre.smallexample {font-size: smaller}
pre.smallformat {font-family: inherit; font-size: smaller}
pre.smalllisp {font-size: smaller}
span.nocodebreak {white-space:nowrap}
span.nolinebreak {white-space:nowrap}
span.roman {font-family:serif; font-weight:normal}
span.sansserif {font-family:sans-serif; font-weight:normal}
ul.no-bullet {list-style: none}
-->
</style>


</head>

<body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
<a name="C_002dStyle-I_002fO-Functions"></a>
<div class="header">
<p>
Previous: <a href="Basic-Input-and-Output.html#Basic-Input-and-Output" accesskey="p" rel="prev">Basic Input and Output</a>, Up: <a href="Input-and-Output.html#Input-and-Output" accesskey="u" rel="up">Input and Output</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>
<hr>
<a name="C_002dStyle-I_002fO-Functions-1"></a>
<h3 class="section">14.2 C-Style I/O Functions</h3>

<p>Octave&rsquo;s C-style input and output functions provide most of the
functionality of the C programming language&rsquo;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 file name 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>
<a name="XREFstdin"></a><dl>
<dt><a name="index-stdin"></a>Built-in Function: <em></em> <strong>stdin</strong> <em>()</em></dt>
<dd><p>Return the numeric value corresponding to the standard input stream.
When Octave is used interactively, this 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>


<a name="XREFstdout"></a><dl>
<dt><a name="index-stdout"></a>Built-in Function: <em></em> <strong>stdout</strong> <em>()</em></dt>
<dd><p>Return the numeric value corresponding to the standard output stream.
Data written to the standard output is normally filtered through the pager.
</p>
<p><strong>See also:</strong> <a href="#XREFstdin">stdin</a>, <a href="#XREFstderr">stderr</a>.
</p></dd></dl>


<a name="XREFstderr"></a><dl>
<dt><a name="index-stderr"></a>Built-in Function: <em></em> <strong>stderr</strong> <em>()</em></dt>
<dd><p>Return the numeric value corresponding to the standard error stream.
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">&bull; <a href="Opening-and-Closing-Files.html#Opening-and-Closing-Files" accesskey="1">Opening and Closing Files</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Simple-Output.html#Simple-Output" accesskey="2">Simple Output</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Line_002dOriented-Input.html#Line_002dOriented-Input" accesskey="3">Line-Oriented Input</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Formatted-Output.html#Formatted-Output" accesskey="4">Formatted Output</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Output-Conversion-for-Matrices.html#Output-Conversion-for-Matrices" accesskey="5">Output Conversion for Matrices</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Output-Conversion-Syntax.html#Output-Conversion-Syntax" accesskey="6">Output Conversion Syntax</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Table-of-Output-Conversions.html#Table-of-Output-Conversions" accesskey="7">Table of Output Conversions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Integer-Conversions.html#Integer-Conversions" accesskey="8">Integer Conversions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Floating_002dPoint-Conversions.html#Floating_002dPoint-Conversions" accesskey="9">Floating-Point Conversions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Other-Output-Conversions.html#Other-Output-Conversions">Other Output Conversions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Formatted-Input.html#Formatted-Input">Formatted Input</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Input-Conversion-Syntax.html#Input-Conversion-Syntax">Input Conversion Syntax</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Table-of-Input-Conversions.html#Table-of-Input-Conversions">Table of Input Conversions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Numeric-Input-Conversions.html#Numeric-Input-Conversions">Numeric Input Conversions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="String-Input-Conversions.html#String-Input-Conversions">String Input Conversions</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Binary-I_002fO.html#Binary-I_002fO">Binary I/O</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="Temporary-Files.html#Temporary-Files">Temporary Files</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="EOF-and-Errors.html#EOF-and-Errors">EOF and Errors</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
<tr><td align="left" valign="top">&bull; <a href="File-Positioning.html#File-Positioning">File Positioning</a>:</td><td>&nbsp;&nbsp;</td><td align="left" valign="top">
</td></tr>
</table>

<hr>
<div class="header">
<p>
Previous: <a href="Basic-Input-and-Output.html#Basic-Input-and-Output" accesskey="p" rel="prev">Basic Input and Output</a>, Up: <a href="Input-and-Output.html#Input-and-Output" accesskey="u" rel="up">Input and Output</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
</div>



</body>
</html>