if u write a class do u write Assignment operator and copy
constructor

Answer Posted / sachin

Compiler provide the assignment operator/ copy constructor
by default. The assignment operator and copy constructor do
the bit wise copy of the object. If user want to do the
member wise copy(ex:allocating the memory from the heap)
for the members, one can write his/her own assignment
operator/ copy constructor.

Is This Answer Correct ?    11 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the 4 main oop principles?

669


INSTANCE FIELDS DECLARED private ARE ACCESSIBLE BY THE METHODS ONLY.CAN WE CHANGE THE private FIELD OF AN OBJECT IN A METHOD OF SOME OTHER OBJECT OF THE SAME CLASS?

1628


When not to use object oriented programming?

563


How do you achieve polymorphism?

605


#include #include #include #include void insert(char *items, int count); int main(void) { char s[255]; printf("Enter a string:"); gets(s); insert(s, strlen(s)); printf("The sorted string is: %s.\n", s); getch(); return 0; } void insert(char *items, int count) { register int a, b; char t; for(a=1; a < count; ++a) { t = items[a]; for(b=a-1; (b >= 0) && (t < items[b]); b--) items[b+1] = items[b]; items[b+1] = t; } } design an algorithm for Insertion Sort

2157






i=20;k=0; for(j=1;k-i;k+=j<10?4:3) { cout<

1409


What is super in oop?

589


is there any choice in opting subjects like 4 out of 7

1725


Give two or more real cenario of virtual function and vertual object

1847


Get me a number puzzle game-program

1686


what is the sylabus for priliminaries?

1677


What is a class in oop?

593


Why do we need polymorphism in c#?

677


What is basic concept of oop?

690


what is graphics

2000