HELP:::MIX numbers in array
I am doing a hw assignment which is a puzzle game and i came to this problem.
I have a 2d array and i have a set of numbers lets say (ex:1-100)
I need to place these numbers randomely in the array.
I initially tried to user srand() and rand() to fill the array with numbers upto 100 but it repeat numbers some times. so it doesn't work.
This is what I have now. Thankx in advance guys. have a good day
b=rand()%need_num; // random number with in need_num
//temp storing the rand # in a array temp
//filling actual array, we leav the emptyspaces as 0's at the end of the