Bloomberg LP Interview Question
Financial Software DevelopersMemory layout includes:
1. memory for non-static data members (consider alignment)
2. simple inheritance is straightforward though a fixed layout is not guaranteed by the C++ standard
2. pointer to virtual table if one exists (implementation dependent)
3. virtual inheritance: it will be an implementation dependent mess. Usually, a pointer to a virtual base object is added to every object directly derived from it.
If an exception is thrown from a destructor, the program crashes and memory is not freed.
E.g. The following crashes when encountering throw.
- Rajika Tandon November 12, 2009