How will you find out if a stack grows up or down in a system? [duplicate]
问题 This question already has answers here : Closed 8 years ago . Possible Duplicates: stack growth direction Does stack grow upward or downward? Hi all, How would I find out if a machine’s stack grows up or down in memory in C. More importantly, which is better: a system in which the stack grows up or one in which a stack grows down ? And will below logic work ??? void sub(int *a) { int b; if (&b > a) { printf("Stack grows up."); } else { printf("Stack grows down."); } } main () { int a; sub(&a)