fbpx

C++

C++ interview question including operators like conversion operator and assignment operator

Operators: What’s the difference between assignment operator and copy constructor copy constructor can do a deep copy whereas assignment is merely a shallow copy ie references. wrong… When not provided, compiler will provide both; which does bitwise copy A copy constructor initialises a new object from an already existing object. An assignment operator is used …

C++ interview question including operators like conversion operator and assignment operator Read More »

C++ interview questions including deep copy, shallow copy, copy constructor

Constructor: How to implement c++’s class’s constructor using the struct in c? #include #include struct PARENT_vtable { int (*Init)(); int (*Add)(); }; struct CHILD_vtable { int (*Init)();//child will override int (*Add)();//parent will define int (*Sub)();//child will define }; int parent_doInit() { printf(“parent init\n”); } int child_doInit() { printf(“child init\n”); } int parent_doAdd() { printf(“parent add\n”); …

C++ interview questions including deep copy, shallow copy, copy constructor Read More »

NOTE!

Check NEW site on stock forex and ETF analysis and automation

Scroll to Top