14.09.2015 Views

Matvec Users’ Guide

Matvec Users' Guide

Matvec Users' Guide

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

40 CHAPTER 5. FILE STREAM CONTROL<br />

> f.close()<br />

> $more try.out<br />

I am testing MATVEC file stream<br />

Pi = 3.14159 2*Pi = 6.28319<br />

5.3 Member Function<br />

5.3.1 open<br />

f.open("","") opens the file stream f. The "" can be either relative or absolute,<br />

and the "" must be one the following or appropriate combination: out, in, app, noreplace.<br />

5.3.2 reopen<br />

f.reopen() reopens the file stream for either writing or reading. not yet available<br />

5.3.3 close<br />

f.close() closes the file stream.<br />

5.3.4 set<br />

f.set("",n) sets value n for the associated flag: "width", "precision", "format", "fill".<br />

5.3.5 out<br />

f.out(arg1,arg2,...) writes out arg1, arg2, ... to the file stream.<br />

5.3.6 in<br />

f.in(arg1,arg2,...) reads in arg1, arg2, ... from the file stream.<br />

not yet available<br />

5.3.7 getline<br />

f.getline() reads and returns a string line from the file stream.<br />

not yet available<br />

5.3.8 eof<br />

f.eof() returns nonzero when the end of the file stream has been reached; otherwise it returns zero.<br />

5.3.9 endl<br />

f.endl() immediately flushes data in the buffer to its destination: either disk or screen.<br />

5.3.10 flush<br />

f.flush() forces the data in the buffer to be physically written to its destination (either disk or screen) in the<br />

same way as endl().<br />

5.3.11 rewind<br />

f.rewind() resets the position indicator to the beginning of the file stream. Note that f must be a read/write<br />

FileStream.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!