A Problem with Dev C++ Compiler - TechRepublic
Question
April 2, 2009 at 02:12 PM
samira_hayat15

A Problem with Dev C++ Compiler

by samira_hayat15 . Updated 17 years, 3 months ago

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.

This discussion is locked

All Comments