lundi 11 janvier 2016

How can I handle System.StackOverflowException?

This error appears sometimes only when I call a recursive function of which one of the parameters is a number: rand()%10. Just like in the code down below:

private: System::Void AIrandomMove(int randomMove,String ^s)
{
/* Implementation */
AIrandomMove(rand()%10,s);  // here it appears the    System.StackOverflowException
}

How can I handle this?




Aucun commentaire:

Enregistrer un commentaire