Bloomberg LP Interview Question
Financial Software DevelopersWell, if I remember right, objects are always created on heap. Correct me if i am wrong
your answer is right but in both the cases memory will be created on heap only. But second one is object so memory will be cleared when it will go out of scope where as in first case memory must be manually cleaned.
Right.
- xankar June 23, 2010The exact statements would be -
1) gets created on the heap.
2) gets created on the stack.
Both will have their default ctors called.