May 14, 2009

Stack Growth Direction.

#include <stdio.h>

void foo(int*);
intmain(intargc,char*argv[])
{
inti;
foo(&i);
}
void foo(int*ii)
{
intj;
if ( &j <>
printf("I think the stack grows down.\n");
else if ( &j > ii )
printf("I think the stack grows up.\n");
else
printf("I'm really confused now.\n");
}

Click Here!