Yeah, you only want to call srand once in the entire program, almost always at the very beginning. Otherwise srand often gets called over and over only milliseconds apart producing very bad random numbers. And you need code tags and proper tabbing when posting your code on here to make your code much more readable. Take a look at what you have above compared to this and see which you think is easier for us to read:
Code:
void CLine::RandomCoOrd()
{
SYSTEMTIME util;
GetSystemTime(&util);
m_XYCoOrds[0][0] = 2; //start point
m_XYCoOrds[0][1] = 18;
m_XYCoOrds[9][0] = 17;//end point
m_XYCoOrds[9][1] = 5;
m_DrawCoOrds[0][0] = 60;
m_DrawCoOrds[0][1] = 60;
m_DrawCoOrds[9][0] = 360;
m_DrawCoOrds[9][1] = 320;
int j = 0; // y axis counter
//srand( util( NULL ) ); // initialize seed "randomly"
srand(GetTickCount());
for(int i=1; i<9; i++)
{
int r = rand() % 21; // generate a random number lower than 20
m_XYCoOrds[i][j] = r;//set the random number as the line coords
r = ((r*20)+20); //convert it to drawable coordinates
m_DrawCoOrds[i][j] = r;
}
j = 1;
for( i=1; i<9; i++)
{
int r = rand() % 21; // generate a random number lower than 20
m_XYCoOrds[i][j] = r;//set the random number as the line coords
r = (((20-r)*20)+20); //convert it to drawable coordinates
m_DrawCoOrds[i][j] = r;
}
}