TransMarket Group Interview Question: If I write an empty class in ... | Glassdoor

Interview Question

Trade Logic Developer Interview(Student Candidate) Chicago, IL

If I write an empty class in C++ (a class with no functions

  or variables), can I do the following: EmptyClass a = new EmptyClass(); EmptyClass b = a;
Tags:
technical, programming, c++
Answer

Interview Answer

1 Answer

0

Yes, because at compile time the compiler will generate an EmptyClass(&EmptyClass ToCopy) constructor that will create a deep-copy of the object.

Interview Candidate on May 15, 2014

Add Answers or Comments

To comment on this, Sign In or Sign Up.