Home » Archives for October 15th, 2009
Output on the Printer
Output on the Printer:
The output of the program can also he sent directly to the printer attached with the computer. Usually the printer is connected to the first parallel port. The first parallel port is called “PRN” or “LPT 1”.
To send the output to the Printer, an output object of ofstream (or fstream) is created and the printer port is assigned...
Seekp Function in C++
The “Seekp” Function:
The “seekp” stands for seek put. This function is used to seek & put the file pointer position (the byte number of next byte) from where the data in the file is to be updated.
The general form of this function is:
object.seekp (pos);
Where
object: represents the created object of ofstream (or fstream).
seekp: represents...
Seekg Function in C++
The “Seekg” Function:
The “seekg” stands for seek get. This function is used to seek & get the file pointer position (the byte number of the next byte) from where the next data of the file is to he read.
The general syntax of this function is:
object.seekg (pos);
Where:
object: represents the created object of ifstream (or fstream).
seekg:...
Random Access Files
Random Access Files:
In data files discussed above, the data (or records) was written into the file in an order, i.e. in a sequence. It was accessed from the tile in the same order in which it was written. This method of accessing data is called sequential and the files are called sequential access files.
Accessing a data item directly is called direct...