Unhandled exception at 0x009B1A39 in rsa.exe: 0xC00000FD: Stack overflow (parameters: 0x00000001, 0x00802FEC). the debug says that the problem is at the gcd if line;
int prime() {
int num = rand() % (100-2+1);
int i = 2;
for (i; i<num; i++)
if (num % i == 0) num = prime();
return num;
}
int gcd(int phi) {
int num = prime();
if (phi % num != 1) num=gcd(phi);
else return num;
}
help pls?
User contributions licensed under CC BY-SA 3.0