I don't know what the heck all this is about. All I know about is that it's a function that produces random number.
So can you explain this whole entire piece of code to me. This is page 46 in K&R C programming language 2nd edition book.
unsigned long int next = 1;
/* rand: return pseudo-random integer on 0..32767 */
int rand(void)
{
next = next * 1103515245 + 12345; /*What the heck is this line doing?????? */
return (unsigned int) (next/65536) % 32768; /*This line, too, I have no idea.. */
}
/* srand: set seed for rand() */
void srand(unsigned int seed)
{
next = seed;
}