Hi

I wrote a funct my_random(limit) that 'should' return a pseudor-random value between 0 and limit-1, then I have a small prog like:

where my_random looks likeCode:main_prog.c .............. int random_value; ............. srand(time(NULL)); // random_value= my_random(limit); // here I call my funct ....

the problem in that i get always the same value. I'm reading some tutorials and I know that is important to choice the right place where put the srand(seed).Code:int my_random(int val){ int rand_choice=0; rand_choice=rand()%(val); printf("%d\n",rand_choice); return rand_choice; }

But I belived that outside the function should be enough, otherwise where should be the right position?

Thanks

D