The error is
"Unhandled exception at 0x00415360 in grid.exe: 0xC0000094: Integer division by zero."
what I'm trying to do is find a random number on a grid.
the grid has already been assigned with numbers
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15
int number; // just any number
int randnum; // number assigned to the grid
int randlong; // random point along x axis
int randhigh; // random point along y axis
int height; // height of the grid
int length; // length of the grid
randhigh = rand() % height;
randlong = rand() % length;
randnum = countgrid[randhigh][randlong];
// randnum > 0
// here is the error
number = rand() % randnum;
I dont know how you grab random numbers because i'm a beginner, but maybe it is grabbing a 0. so just check to make sure it doesnt grab a 0 before performing the operation. And int the rand() % something; part of your code it looks like ur using modulus operator and maybe returning 0?