This is not a way to get M random numbers without repeating. You should make a sequence of numbers 1,2,3,4, … N, where N more or equals M, and then loop throught that sequnce interchanging numbers at random place, then take frist M numbers.

Also you missing arrays. This tomb[] = currentID; assigns number to array which make no sense. To put something into array you need an index, like this