Originally Posted by
john.c
That's not quite right. Although the pointer lives on main's stack, the memory it points to is on the heap since it is (presumably) dynamically allocated by readline. Note that that memory is freed in main in the loop that pops the stack elements.