[contents]
Contents
Syntax
The syntax for getline calls is:
f++:
getline{option}(istream, params)
n++:
@getline{option}(istream, params)
Description
The getline function is for reading a line of input, it takes a non-zero number of parameters, the first parameter should be an input stream (either console, a file stream or a string stream), the remainder of the parameters should be either ofile where input is injected directly to the file being built or a string variable name to read in to. Having one input parameter is the same as having a second parameter that is ofile. If not reading to the output file being built getline will return whether or not it was successful.
Options
The following options are available for getline calls:
| option |
description |
| !r |
no return value |
| option |
description |
f++ example
Examples of getline being used with f++:
- :=(string, s)
- getline(console, s)
- :=(string, s)
- :=(ifstream, ifs("input.txt"))
- while(getline(ifs, s))
- console(s)
- ifs.close()
n++ example
Examples of getline being used with n++:
- @:=(string, s)
- @getline{!r}(console, s)
- @:=(string, s)
- @:=(ifstream, ifs("input.txt"))
- @while(getline(ifs, s))
- @console(s)
- @ifs.close()