Stack and Heap Space for Modern Computers
When writing in C, how can I tell how much stack space is available in memory when I launch a program? How about heap space? How can I tell how much memory is being used during the execution of my program? This is all Win32-specific (not really C-specific, all just OS API): When a thread is created, it gets 1MB stack space by default, by that can be modified in whatever CreateThread API you use. You can peek into the thread information block to find the actual stack info, but even though this is documented, this technique isn't officially supported, see http://en.wikipedia.org/wiki/Win32