Ondrej Hava - 2013-11-14

Be careful, I was also able to compile but not to execute. random() behaves differently than rand() which causes occasional assignment of non-existing topic and program crash. random() generates number less than RAND_MAX while rand() generate number less or equal to RAND_MAX. I fixed the problem by changing RAND_MAX by (RAND_MAX + 1) in all formulas like ((double)random() / RAND_MAX).