Without Book Interview Questions and Answers | Online Test | Moct Test
Download Android App in your Android Device from Google Play Store
- Search for "Withoutbook Practice Exam Test" in Mobile/Tablet Play Store
Institute Training Search by Name or Email

Exams Attended

Make Homepage

Bookmark this page

Subscribe Email Address

C++ Interview Questions and Answers

Ques 31. What is a COPY CONSTRUCTOR and when is it called?

Ans.
A copy constructor is a method that accepts an object of the same class and copies it?s data members to the object on the left part of assignement:

class Point2D{
int x; int y;

public int color;
protected bool pinned;
public Point2D() : x(0) , y(0) {} //default (no argument) constructor
public Point2D( const Point2D & ) ;
};

Point2D::Point2D( const Point2D & p )
{
this->x = p.x;
this->y = p.y;
this->color = p.color;
this->pinned = p.pinned;
}

main(){
Point2D MyPoint;
MyPoint.color = 345;
Point2D AnotherPoint = Point2D( MyPoint ); // now AnotherPoint has color = 345

Is it helpful? Add Comment View Comments
Ques 32. What is Boyce Codd Normal form?
Ans.
A relation schema R is in BCNF with respect to a set F of functional dependencies if for all functional dependencies in F+ of the form a-> , where a and b is a subset of R, at least one of the following holds:
* a- > b is a trivial functional dependency (b is a subset of a)
* a is a superkey for schema R
Is it helpful? Add Comment View Comments
Ques 33. What is virtual class and friend class?
Ans.
Friend classes are used when two or more classes are designed to work together and need access to each other's implementation in ways that the rest of the world shouldn't be allowed to have. In other words, they help keep private things private. For instance, it may be desirable for class DatabaseCursor to have more privilege to the internals of class Database than main() has.
Is it helpful? Add Comment View Comments
Ques 34. What is the word you will use when defining a function in base class to allow this function to be a polimorphic function?
Ans.
virtual
 
Is it helpful? Add Comment View Comments
Ques 35. What do you mean by binding of data and functions?
Ans.
Encapsulation.
Is it helpful? Add Comment View Comments

Most helpful rated by users:

©2016 WithoutBook