Skip to content

Instantly share code, notes, and snippets.

@hpcx82
Created July 23, 2011 06:05
Show Gist options
  • Save hpcx82/1101091 to your computer and use it in GitHub Desktop.
Save hpcx82/1101091 to your computer and use it in GitHub Desktop.
Check if the stack grow downwards - it is determined by cpu's push/pop instructions, but OS could redefine the behavior
bool IsStackGrowDownwards()
{
int mark1 = 0;
int mark2 = 0;
return &mark2 < &mark1;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment