![]() |
Some mind teasers
I will put some mind teasers of C++ in this thread and if you have just go on adding them.
|
Re: Some mind teasers
We have
const A& operator=(const A& obSrc) and A& operator=(const A& obSrc) What is the difference? |
Re: Some mind teasers
Are there any reasons one should avoid using static variables in abstract base classes?
|
Re: Some mind teasers
How will you call a C++ function from C and Vice Versa?
|
Re: Some mind teasers
Hi.
Code Sample Code:
#include <iostream>Constructor throws an exception. Now will the destructor be called ? When is the memory allocated when a new is called? Is it after the constructor is executed or just when the constructor starts? What happens with memory allocated for the object itself? Who's responsible for deallocating it in such a case? |
Re: Some mind teasers
Is it possible to catch an assertion error?
assert (false); catch (...) {} |
Re: Some mind teasers
Is it possible to implement a Singleton without using static variables or global variables.
|
Re: Some mind teasers
Why constructors do not have return values?
What if I want to check whether the object is successfully created. We could have checked that by returning some value and finding it. |
Re: Some mind teasers
Write a simple template program where the .h files contains the class definition and .cpp files contains the class declaration.
|
Re: Some mind teasers
List the operators that cannot be overloaded normally as well as friend functions?
|
| All times are GMT +5.5. The time now is 06:35. |