description | title | ms.date | f1_keywords | ms.assetid | ||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
Learn more about: <fstream> typedefs |
<fstream> typedefs |
11/04/2016 |
|
8dddef2d-7f17-42a6-ba08-6f6f20597d23 |
filebuf
fstream
ifstream
ofstream
wfilebuf
wfstream
wifstream
wofstream
A type basic_filebuf
specialized on char
template parameters.
typedef basic_filebuf<char, char_traits<char>> filebuf;
The type is a synonym for class template basic_filebuf
, specialized for elements of type char
with default character traits.
A type basic_fstream
specialized on char
template parameters.
typedef basic_fstream<char, char_traits<char>> fstream;
The type is a synonym for class template basic_fstream
, specialized for elements of type char
with default character traits.
Defines a stream to be used to read single-byte character data serially from a file. ifstream
is a typedef that specializes the class template basic_ifstream
for char
.
There is also wifstream
, a typedef that specializes basic_ifstream
to read wchar_t
double-wide characters. For more information, see wifstream
.
typedef basic_ifstream<char, char_traits<char>> ifstream;
The type is a synonym for class template basic_ifstream
, specialized for elements of type char with default character traits. An example is
using namespace std;
ifstream infile("existingtextfile.txt");
if (!infile.bad())
{
// Dump the contents of the file to cout.
cout << infile.rdbuf();infile.close();
}
A type basic_ofstream
specialized on char
template parameters.
typedef basic_ofstream<char, char_traits<char>> ofstream;
The type is a synonym for class template basic_ofstream
, specialized for elements of type char
with default character traits.
A type basic_fstream
specialized on wchar_t
template parameters.
typedef basic_fstream<wchar_t, char_traits<wchar_t>> wfstream;
The type is a synonym for class template basic_fstream
, specialized for elements of type wchar_t
with default character traits.
A type basic_ifstream
specialized on wchar_t
template parameters.
typedef basic_ifstream<wchar_t, char_traits<wchar_t>> wifstream;
The type is a synonym for class template basic_ifstream
, specialized for elements of type wchar_t
with default character traits.
A type basic_ofstream
specialized on wchar_t
template parameters.
typedef basic_ofstream<wchar_t, char_traits<wchar_t>> wofstream;
The type is a synonym for class template basic_ofstream
, specialized for elements of type wchar_t
with default character traits.
A type basic_filebuf
specialized on wchar_t
template parameters.
typedef basic_filebuf<wchar_t, char_traits<wchar_t>> wfilebuf;
The type is a synonym for class template basic_filebuf
, specialized for elements of type wchar_t
with default character traits.