beginner question recursive functions c memory problem ?
i`m trying to code some recursive algorithm and run into a segmentation fault upon executing the program. since i`m quite new to programming, especially in c, i wrote the following piece of code just to find out how far i can go with, what looks to me, the simplest recursive function there is.
the thing is that on my machine i get to 523797 after which the segmentation fault appears and i would have thought that it should go much farther than that.
void x(long a) // the recursive function which calls itself in order to increase a by one
Could anyone explain to me why the segmentation fault appears (i guess its a memory thing) cos i don`t really see why it occurs at such an early stage.
thx a million in advance.