Quantcast
Channel: how to find if stack increases upwards or downwards? - Stack Overflow
Browsing all 5 articles
Browse latest View live

Answer by Thomas Matthews for how to find if stack increases upwards or...

Create function with many local variables.Turn off optimizations.Either print the assembly language.. Or when debugging, display as mixed source and assembly language. Note the stack pointer (or...

View Article



Answer by 3Dave for how to find if stack increases upwards or downwards?

This is very platform-dependent, and even application-dependent.The code posted by Vino only works in targets where parameters are passed on the stack AND local variables are allocated from the stack,...

View Article

Answer by mjh2007 for how to find if stack increases upwards or downwards?

Brute force approach is to fill your memory with a known value say 0xFF. Push some items on the stack. Do a memory dump. Push some more items on the stack. Do another memory dump.

View Article

Answer by Vino for how to find if stack increases upwards or downwards?

One possible way is...#include <stdio.h>void call(int *a) { int b; if (&b > a) printf("Stack grows up.\n"); else printf("Stack grows down.\n");}int main () { int a; call(&a); return 0;}

View Article

how to find if stack increases upwards or downwards?

how to find if stack increases upwards or downwards?

View Article

Browsing all 5 articles
Browse latest View live




Latest Images