|
-
April 15th, 2003, 06:53 AM
#1
Stack and Heap problem
How to know a variable is defined on to stack or heap. Is Win OS providing any API to know it.
-
April 15th, 2003, 09:40 AM
#2
You could create a class and override operator new() to set a flag when something is created on the heap.
-
April 15th, 2003, 10:29 AM
#3
Re: Stack and Heap problem
Originally posted by Saurabh Gupta
How to know a variable is defined on to stack or heap. Is Win OS providing any API to know it.
There is no standard way to determine if a variable is created on the heap or the stack, and there is no Windows API to guarantee this..
Having to know if a variable is created on the stack or heap sounds like a design flaw. If you can tell us what you're trying to accomplish, maybe someone can suggest alternatives.
Regards,
Paul McKenzie
-
April 15th, 2003, 02:22 PM
#4
Maybe he is trying to create an auto-deleter like CException.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|