Home » Archives for October, 2009
Inheritance
Inheritance:
Inheritance is the second most important feature of the Object Oriented Programming. In inheritance, the code of existing classes is used for making new classes. This saves time for writing and debugging the entire code for a new class.
To inherit means to receive. In inheritance a new class is written such that it can access or use the members...
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...
Writing and Reading Objects into Files
Writing and Reading Objects into Files:
The objects of a class can also be written into the file on the disk and read back from the file. The objects are written & read in binary format with the “write” member function. Similarly, they are read from the tile with the “read” member function.
When an object is written on the disk into a tile then...
The Read Function in C++
The Read Function:
The “read” function is used to read data or records from the data file into the memory as blocks of bytes. The general syntax of this function is:
object.read ((char*)&rec, sizeof(rec));
where
object: represents the created object of ifstream (or fstream).
read: represents the member function of the created object.
char*: represents data...
The Write Function in C++
The Write Function:
The “write” function writes data or records into a data file in bytes. It writes an object consisting of a block of bytes into the data file. All types of data like struct, array, class object, graphics, etc. can he stored into the tile on the disk by this function. The general syntax of this function is:
object.write ((char*) & rec, sizeof(rec)) ;
Where
object:...
Binary Input Output
Binary Input Output:
In binary input/output, data or records are stored into files in binary format. For example, in binary format, each integer takes two bytes. Thus the integer “30765” will take only two bytes on the disk but in case of formatted input/output, this integer takes 5 bytes of space in the memory as well as on the disk.
The binary format is commonly used to organize large amount...
Exploratory Research
Exploratory Research
When a researcher wants to deal with a new issue or try to begin a new research is called exploratory research. The objective of such research is to formulate very precise questions that can answer in future research. It might be the first stage of the series of studies.
Initially a research is conducted to explain the nature of the problem. The researchers having limited...