When copy constructor can be used?

Answer Posted / vikas sood

hi fellows..try this code
class A {
public:
A() { }
A(const A& rhs)
{
cout<<"inside copy constructor..";
}
};

int main()
{
std::vector<A> aVec(10);
}

The answer to this is another reason a copy constructor
will be called.

Is This Answer Correct ?    2 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Explain the operation of overloading of an assignment operator.

880


What are the operators in c++?

838


Which software is used to run c++ program?

707


State two differences between C and C++.

787


Are iterators pointers?

879






What is meant by iomanip in c++?

816


What are friend classes?

820


Define a nested class.

806


What is #include cmath?

825


Define macro.

802


What is isdigit c++?

809


What is the best c++ book for beginners?

795


Do the parentheses after the type name make a difference with new?

832


what is software cycle? What is a mission critical system ? What is the important aspect of a real-time system ? Explain the difference between microkernel and macro kernel. Give an example of microkernel.Why paging is used ? Which is the best page replacement algo and Why ? What is software life cycle ? How much time is spent usually in each phases and why Which one do U want to work if selected in Honeywell ? Which are the different types of testing ? What is a distributed system ? Some questions about CSP. Which languages do U know ? What are the differences between Pascal and C. questions from Compiler construction and Lisp. Which are the different computer architecture? What is the requirement in MIMD ? What is the difference between RISC and CISC processors ? Difference between loosely coupled and tightly coupled systems ? What is an open system?

1971


What does std mean in c++?

785