Quote Originally Posted by CyberShot View Post
The strange thing is that the code works just fine if I put it in a while loop.
The code you did post does the following:

selection calls addchecksum, which calls selection, which calls addchecksum, which calls selection, which calls addchecksum ...

A few of these, and your stack space gets exhausted. Imagine if your program was supposed to be run non-stop.

There is no need for recursion in such a simple program. So when you say "while loop", are you referring to the code you posted or different code?

Regards,

Paul McKenzie