Question Locked

A Problem with Dev C++ Compiler

0 helpful
1 reply
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

I am trying to use the rand() function in the Dev C++ compiler. When i try to execute and run the whole code, the output window appears but is quickly followed by a "Send Error Report" window, i've tried to isolate the piece of code that was responsible for this and found out that if i comment out the following line, the rest works fine:

for (i=0;i<9;i++)
{
Genotype[i]=(rand()%i);

}
Does anyone have any idea why that happens? is it to do with the fact that i's value is being gotten through a loop? cz when i change 'i' and write rand()%2, it works.

1 reply

This discussion is closed to new replies.