How to know if a pointer points to the heap or the stack?

There is no way of doing this – and if you need to do it, there is something wrong with your design. There is a discussion of why you can’t do this in More Effective C++.

Leave a Comment