You are on page 1of 2

====My Project is Based On Banking System which handles transactions====

====OOPs Concepts Applied In The Projects are:====


1. Encapsulation.
2. Data Abstraction.
3. Data Hiding.
4. Classes and Objects.

====File.write((char*)&s,sizeof(s));====

In this line, write function is used to write a block of


data to the file and is a member of File object of type
ofstream or fstream class.
It has two parameters. First parameter (char*)&s depicts
the explicit typecasting which is converting an object into
string (for bytes) and the second parameter sizeof(s),
specifies number of bytes written to file. The same concept
is used with the read function which reads a block of data
from file and is also a member function of File object of
ifstream or fstream class.

====Logic of modification of a record====

Modification of a record means changing the values of an


existing record in a file. For Modification following Five
steps are used:
Read - Read the record.
Check - Check the record for change, if it is the record
to change then - CHANGE the value of object. And GOBACK to
the beginning of record usng seekg() or seekp() operation.
After that WRITE the record to file and break the while
loop.

====DIFFERENCE B/W Call By Value & Call By Reference====

1. In Call By Value method a copy of actual parameter is


created for formal parameters. Hence value of the
corresponding actual parameter remains unchanged.
Whereas in case of Call by reference method a reference
of actual parameter is passed to the formal parameters.
Hence value of the corresponding actual parameter gets changed.

2. In Call By Value method actual parameters can be any


expression, constant or a variable whereas in Call By Reference
method actual parameters can be variables only.

====DIFFERENCE B/W #define & typedef====

#define is a preprocessor statement which gives name to a constant


and also defines a macro functions, in which code gets substituted
at the place of a function call.
#define MAX 80
#define sum(x, y) x+y

Typedef is a statement which gives name to a datatype and ends with


a ;
typedef float amount;

====Private Section & Protected Section====


The Protected section can be inherited to a derived class whereas
a Private section cannot be further inherited to a derived class.
Both are accessible through the members of the class only.

====Multilevel and Multiple Inheritance====

In Multilevel Inheritance there are more than one level of


Inheritance is seen. Where as in case of Multiple Inheritance
a single derived class is derived from more than one base class.

====Copy Constructor====

A copy constructor is used to copy the data of an object to another


object of same class. It gets invoked under three conditions.
1. When an object is initialized with other object.
Sample s1=s2;
2. When an object is returned. Sample f1();
3. When an object is passed using Call By Value method.
void fun(sample s);

====DIFFERENCE B/W ios::app & ios::out====

When a file is created for the first time both modes work same
i.e, add records to the file.
For an existing file ios::out mode erases the previous records
and write from beginning whereas in ios::app mode appends more
records to the file without erasing data.

You might also like