What is the Diffrence between a "assignment operator" and a
"copy constructor"?
Answers were Sorted based on User's Feedback
Answer / kishore
Copy constructors are used during class object
initialization and assignment operators are invoked during
object assignment.
XYZ c;
XYZ Obj = c; -> invoke copy constructor
XYZ d;
d = c; -> invoke assignment operator
| Is This Answer Correct ? | 7 Yes | 0 No |
Answer / bheda govind
Assignment operater are types,
(1)simple
(2)compond a+=5
(3)expresion a=a+b
| Is This Answer Correct ? | 1 Yes | 0 No |
Answer / dee
assignment operator copies the values of one object to
another of the same class.It will excute only when the
right side of the variable is object and two sides are not
equal.It does shallow copy
Copy constructor craetes the object if its not existing and
copies the values of another object of the same class and
it does the deep copy.
| Is This Answer Correct ? | 1 Yes | 1 No |
Explain register storage specifier.
What is else if syntax?
Write a program to calculate the BMI of a person using the formula BMI = weight/height2.
What is static function? Explain with an example
If dog is a friend of boy, is boy a friend of dog?
How does throwing and catching exceptions differ from using setjmp and longjmp?
What are the uses of pointers?
Show the declaration for a pointer to function returning long and taking an integer parameter.
Which is better c++ or java?
How will you call C functions from C ++ and vice-versa?
0 Answers Agilent, Tavant Technologies, Thomson Reuters, Verifone,
Will c++ be replaced?
Does c++ support exception handling?