Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Zortech C++ 3.0r4 - <b>ifstream::ifstream</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
ifstream::ifstream

Usage

   #include <fstream.hpp>
   ifstream::ifstream();

   ifstream(const char *name, int io_mode = ios::in,
               int protection = filebuf::openprot);
   ifstream(int file_descriptor);
   ifstream(int file_descriptor, char *memory, int length);

Description

   Four constructor options are provided. The default constructor sets up a
   filebuf which will dynamically allocate its buffer area, and can be
   associated with a file later using the attach() or open() functions. The
   default constructor sets the error state to ios::badbit, since the stream
   is initially unusable.

   The second constructor attempts to open the named file. The default open
   mode may be overriden, as may the file protection. The third constructor
   sets up an ifstream using the file descriptor of an already opened file,
   while the fourth does the same but allows the user to specify a buffer
   area. Unbuffered operation may be forced by a zero memory argument or a
   length argument <= zero.

Example 

   ifstream ifs1;
   ifstream ifs2("input.dat");
   int fd = open(...);
   ifstream ifs3(fd);
   ifstream ifs4(fd,0,0);  // unbuffered





Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson