WAP-in-C-for-stack- stack using dynamic aray step 1 it is quite wonderful approach you can dynamically allocate the memory for stack.